@base44-preview/sdk 0.8.44-pr.264.1c7c943 → 0.8.44-pr.264.d98f3ac
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/auth.js +4 -7
- package/package.json +1 -1
package/dist/modules/auth.js
CHANGED
|
@@ -54,11 +54,6 @@ function loginViaPopup(url, redirectUrl, expectedOrigin) {
|
|
|
54
54
|
}, 500);
|
|
55
55
|
window.addEventListener("message", onMessage);
|
|
56
56
|
}
|
|
57
|
-
// "token" is the key the platform-v2 built-in SDK wrote.
|
|
58
|
-
function removeStoredAccessTokens() {
|
|
59
|
-
removeAccessToken({});
|
|
60
|
-
removeAccessToken({ storageKey: "token" });
|
|
61
|
-
}
|
|
62
57
|
/**
|
|
63
58
|
* Creates the auth module for the Base44 SDK.
|
|
64
59
|
*
|
|
@@ -123,7 +118,8 @@ export function createAuthModule(axios, functionsAxiosClient, appId, options) {
|
|
|
123
118
|
const loginUrl = `${options.appBaseUrl}/login?from_url=${encodeURIComponent(redirectUrl)}`;
|
|
124
119
|
// The login page must not boot with the token that just got us here,
|
|
125
120
|
// or a rejected token redirects to /login forever.
|
|
126
|
-
|
|
121
|
+
removeAccessToken({});
|
|
122
|
+
removeAccessToken({ storageKey: "token" });
|
|
127
123
|
window.location.href = loginUrl;
|
|
128
124
|
},
|
|
129
125
|
// Redirects the user to a provider's login page
|
|
@@ -162,7 +158,8 @@ export function createAuthModule(axios, functionsAxiosClient, appId, options) {
|
|
|
162
158
|
hasAccessToken = false;
|
|
163
159
|
// Only do the rest if in a browser environment
|
|
164
160
|
if (typeof window !== "undefined") {
|
|
165
|
-
|
|
161
|
+
removeAccessToken({});
|
|
162
|
+
removeAccessToken({ storageKey: "token" });
|
|
166
163
|
// Determine the from_url parameter
|
|
167
164
|
const fromUrl = redirectUrl || window.location.href;
|
|
168
165
|
// Redirect to server-side logout endpoint to clear HTTP-only cookies
|