requireAuth-fix-2

This commit is contained in:
Untone 2024-01-23 00:03:57 +03:00
parent 92eae0347b
commit 30e143e081

View File

@ -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)