Fix Stale User Session with Proper fetch Error Handling (#4770)

* add refresh user functionality

* prettier

* add eslint disable comment for exhaustive-deps warning in AuthContext to stop nagging about navigate func

* remove unused imports and fix typo

* handle unsafe parse of undefined for in-session user deleted

* Refactor refreshUser function to handle errors and return structured response. Update AuthProvider to manage user data based on success status.

* Remove console error logging from promise catch in System model for cleaner error handling.

* change status from 404 to 400 and valid to success

* Refactor error handling in AuthProvider's refreshUser logic to remove redundant catch block and streamline user session management on failure.

* prettier

* reorder clauses - return errors

* refactor
account for all user modes
dev build

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
This commit is contained in:
Marcello Fitton
2025-12-12 11:43:20 -08:00
committed by GitHub
parent c76b0708c3
commit 8aa78c2b75
4 changed files with 107 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ concurrency:
on:
push:
branches: ['migrate-to-bcryptjs'] # put your current branch to create a build. Core team only.
branches: ['bug-user-session-stale'] # put your current branch to create a build. Core team only.
paths-ignore:
- '**.md'
- 'cloud-deployments/*'