@base44-preview/sdk 0.8.17-pr.77.030ba28 → 0.8.17-pr.77.cbf4b6e
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 -0
- package/package.json +1 -1
package/dist/modules/auth.js
CHANGED
|
@@ -25,6 +25,10 @@ export function createAuthModule(axios, functionsAxiosClient, appId, options) {
|
|
|
25
25
|
if (typeof window === "undefined") {
|
|
26
26
|
throw new Error("Login method can only be used in a browser environment");
|
|
27
27
|
}
|
|
28
|
+
// Skip redirect if already on login page to avoid redirect loop
|
|
29
|
+
if (window.location.pathname === "/login") {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
28
32
|
// If nextUrl is not provided, use the current URL
|
|
29
33
|
const redirectUrl = nextUrl
|
|
30
34
|
? new URL(nextUrl, window.location.origin).toString()
|