From 13e21b3b6740d6496e2cedc80fe4cd382115cbb7 Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Mon, 8 Apr 2024 11:18:44 +0200 Subject: [PATCH] Session: get refresh token from local storage in case not in ram already (#2048) --- front/src/utils/Session.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/front/src/utils/Session.js b/front/src/utils/Session.js index 73b25c4254..6db38af7a9 100644 --- a/front/src/utils/Session.js +++ b/front/src/utils/Session.js @@ -97,15 +97,17 @@ class Session { } getRefreshToken() { - if (this.user) { - return this.user.refresh_token; + const user = this.getUser(); + if (user) { + return user.refresh_token; } return null; } getAccessToken() { - if (this.user) { - return this.user.access_token; + const user = this.getUser(); + if (user) { + return user.access_token; } return null; }