fix: LW ticket site auth state conflict with studio (#28336)

This commit is contained in:
Alaister Young authored and GitHub committed 2024-08-02 18:44:03 +08:00
1 parent c0de659400
commit 1db34e9156
1 file changed
+5 -1
+5 -1
View File
@@ -21,6 +21,10 @@ const shouldEnableNavigatorLock =
process.env.NEXT_PUBLIC_IS_PLATFORM === 'true' &&
!(globalThis?.localStorage?.getItem(AUTH_NAVIGATOR_LOCK_DISABLED_KEY) === 'true')
const shouldDetectSessionInUrl = process.env.NEXT_PUBLIC_AUTH_DETECT_SESSION_IN_URL
? process.env.NEXT_PUBLIC_AUTH_DETECT_SESSION_IN_URL === 'true'
: true
const navigatorLockEnabled = !!(shouldEnableNavigatorLock && globalThis?.navigator?.locks)
if (shouldEnableNavigatorLock && !globalThis?.navigator?.locks) {
@@ -103,7 +107,7 @@ const logIndexedDB = (message: string, ...args: any[]) => {
export const gotrueClient = new AuthClient({
url: process.env.NEXT_PUBLIC_GOTRUE_URL,
storageKey: STORAGE_KEY,
detectSessionInUrl: true,
detectSessionInUrl: shouldDetectSessionInUrl,
debug: debug ? (persistedDebug ? logIndexedDB : true) : false,
lock: navigatorLockEnabled ? navigatorLock : undefined,
})