requireAuth-fix-2
This commit is contained in:
parent
92eae0347b
commit
30e143e081
|
@ -255,13 +255,21 @@ export const SessionProvider = (props: {
|
|||
const requireAuthentication = async (callback: () => void, modalSource: AuthModalSource) => {
|
||||
setIsAuthWithCallback(() => callback)
|
||||
|
||||
await loadSession()
|
||||
|
||||
if (!session()) {
|
||||
showModal('auth', modalSource)
|
||||
await loadSession()
|
||||
if (!session()) {
|
||||
showModal('auth', modalSource)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
createEffect(() => {
|
||||
if (isAuthWithCallback()) {
|
||||
isAuthWithCallback()()
|
||||
setIsAuthWithCallback(null)
|
||||
}
|
||||
})
|
||||
|
||||
// authorizer api proxy methods
|
||||
const signUp = async (params: SignupInput) => {
|
||||
const authResult: void | AuthToken = await authorizer().signup(params)
|
||||
|
|
Loading…
Reference in New Issue
Block a user