Skip to content

Commit

Permalink
Merge pull request #49 from marmelab/fix/login-after-signup
Browse files Browse the repository at this point in the history
fix(login): Fix user is not automatically logged in after signup
  • Loading branch information
arimet authored Aug 9, 2024
2 parents 22b4ebf + 73bb690 commit 38ce68e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/providers/supabase/authProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 38ce68e

Please sign in to comment.