From 73bb690af859c64e38dda5e3afa1e745b184c00e Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kaiser Date: Thu, 8 Aug 2024 18:49:13 +0200 Subject: [PATCH] fix(login): Fix user is not automatically logged in after signup --- src/providers/supabase/authProvider.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/providers/supabase/authProvider.ts b/src/providers/supabase/authProvider.ts index 0ed2597..eb300cd 100644 --- a/src/providers/supabase/authProvider.ts +++ b/src/providers/supabase/authProvider.ts @@ -55,6 +55,28 @@ export namespace getIsInitialized { export const authProvider: AuthProvider = { ...baseAuthProvider, checkAuth: async params => { + // Users are on the set-password page, nothing to do + if ( + window.location.pathname === '/set-password' || + window.location.hash.includes('#/set-password') + ) { + return; + } + // Users are on the forgot-password page, nothing to do + if ( + window.location.pathname === '/forgot-password' || + window.location.hash.includes('#/forgot-password') + ) { + return; + } + // Users are on the sign-up page, nothing to do + if ( + window.location.pathname === '/sign-up' || + window.location.hash.includes('#/sign-up') + ) { + return; + } + const isInitialized = await getIsInitialized(); if (!isInitialized) {