Skip to content

Commit

Permalink
Session: get refresh token from local storage in case not in ram alre…
Browse files Browse the repository at this point in the history
…ady (#2048)
  • Loading branch information
Pierre-Gilles authored Apr 8, 2024
1 parent 9109e8a commit 13e21b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions front/src/utils/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 13e21b3

Please sign in to comment.