Improve authentication state management and user session handling

Refactors the `AuthProviderComponent` in `useAuth.tsx` to enhance the handling of Supabase authentication state changes. Updates console logs for better debugging, prioritizes setting pending email state before early returns, and refines the logic for `SIGNED_IN`, `INITIAL_SESSION`, and `SIGNED_OUT` events. Also defers Novu updates and profile fetches to prevent blocking the authentication process.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: e7030bef-c72b-4948-9378-ee5e345d91ce
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7cdf4e95-3f41-4180-b8e3-8ef56d032c0e/e7030bef-c72b-4948-9378-ee5e345d91ce/zQglahT
This commit is contained in:
pac7
2025-10-12 17:05:15 +00:00
parent da3a5247a1
commit 0b8fe60823
2 changed files with 40 additions and 55 deletions

View File

@@ -37,3 +37,7 @@ externalPort = 80
[[ports]]
localPort = 5001
externalPort = 3000
[[ports]]
localPort = 37143
externalPort = 3001