Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

fix(login): Fix user is not automatically logged in after signup

Jean-Baptiste Kaiser73bb690af859
diff --git a/src/providers/supabase/authProvider.ts b/src/providers/supabase/authProvider.ts
index 0ed2597e..eb300cdf 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) {