Skip to content

Commit

Permalink
fix(storage): return undefined not null when get tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
matiaslopezd committed Apr 7, 2022
1 parent 4f675fb commit c21afd5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 15 additions & 5 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ class WebAuth {
*/
getTokens(token) {
const tokens = {
accessToken: window[this.storage].getItem(this.keys.accessToken),
refreshToken: window[this.storage].getItem(this.keys.refreshToken)
accessToken: window[this.storage].getItem(this.keys.accessToken) || undefined,
refreshToken: window[this.storage].getItem(this.keys.refreshToken) || undefined
};
this.debug('log', `Getting token from ${this.storage}`, tokens);
return token ? tokens[token] : tokens;
Expand Down

0 comments on commit c21afd5

Please sign in to comment.