Route app auth through workspace client
This commit is contained in:
+4
-4
@@ -14,7 +14,7 @@ import {
|
||||
import {
|
||||
createSession,
|
||||
defaultTranslationId,
|
||||
hostedWorkspaceEnabled,
|
||||
getAuthClient,
|
||||
loadHostedSession,
|
||||
loadWorkspaceSnapshot,
|
||||
loginHostedWorkspace,
|
||||
@@ -461,7 +461,7 @@ function App() {
|
||||
setAuthRequired(false)
|
||||
workspaceHydrated.current = false
|
||||
|
||||
if (hostedWorkspaceEnabled()) {
|
||||
if (getAuthClient().enabled) {
|
||||
const session = await loadHostedSession()
|
||||
if (cancelled()) return
|
||||
setHostedUser(session.user)
|
||||
@@ -521,7 +521,7 @@ function App() {
|
||||
studySettings: studySettingsSnapshot,
|
||||
}).catch((reason) => {
|
||||
console.warn(
|
||||
hostedWorkspaceEnabled()
|
||||
getAuthClient().enabled
|
||||
? 'Unable to save hosted workspace.'
|
||||
: 'Unable to save local workspace.',
|
||||
reason,
|
||||
@@ -2547,7 +2547,7 @@ function App() {
|
||||
|
||||
const splitTemplate = `${splitPercent}fr 6px ${100 - splitPercent}fr`
|
||||
|
||||
if (authRequired && hostedWorkspaceEnabled()) {
|
||||
if (authRequired && getAuthClient().enabled) {
|
||||
return renderHostedLogin()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user