mirror of
https://github.com/enso-org/enso.git
synced 2024-11-26 08:52:58 +03:00
Fix offline mode (#7250)
* Fix offline mode * Remove `authentication=false` from URL when logging in --------- Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
This commit is contained in:
parent
ca68dd94da
commit
b042807790
@ -271,6 +271,11 @@ export function AuthProvider(props: AuthProviderProps) {
|
||||
await new Promise(resolve => setTimeout(resolve, REQUEST_DELAY_MS))
|
||||
}
|
||||
}
|
||||
const url = new URL(location.href)
|
||||
if (url.searchParams.get('authentication') === 'false') {
|
||||
url.searchParams.delete('authentication')
|
||||
history.replaceState(null, '', url.toString())
|
||||
}
|
||||
let newUserSession: UserSession
|
||||
const sharedSessionData = { email, accessToken }
|
||||
if (!organization) {
|
||||
@ -307,10 +312,10 @@ export function AuthProvider(props: AuthProviderProps) {
|
||||
})
|
||||
// `userSession` MUST NOT be a dependency as this effect always does a `setUserSession`,
|
||||
// which would result in an infinite loop.
|
||||
// `initialized` MUST NOT be a dependency as it breaks offline mode.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [
|
||||
cognito,
|
||||
initialized,
|
||||
logger,
|
||||
onAuthenticated,
|
||||
session,
|
||||
|
Loading…
Reference in New Issue
Block a user