Skip to content

Commit c5bfb2a

Browse files
authored
set token on "token" key in local storage as well (#37)
1 parent ed276a8 commit c5bfb2a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/modules/auth.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ export function createAuthModule(
115115
) {
116116
try {
117117
window.localStorage.setItem("base44_access_token", token);
118+
// Set "token" that is set by the built-in SDK of platform version 2
119+
window.localStorage.setItem("token", token);
118120
} catch (e) {
119121
console.error("Failed to save token to localStorage:", e);
120122
}

src/utils/auth-utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export function saveAccessToken(
9393

9494
try {
9595
window.localStorage.setItem(storageKey, token);
96+
// Set "token" that is set by the built-in SDK of platform version 2
97+
window.localStorage.setItem("token", token);
9698
return true;
9799
} catch (e) {
98100
console.error("Error saving token to localStorage:", e);

0 commit comments

Comments
 (0)