fix: prevent 500 error loop by adding error handling to auth redirect#45
Open
1028bc wants to merge 1 commit intoOpire:mainfrom
Open
fix: prevent 500 error loop by adding error handling to auth redirect#451028bc wants to merge 1 commit intoOpire:mainfrom
1028bc wants to merge 1 commit intoOpire:mainfrom
Conversation
|
Someone is attempting to deploy a commit to the Opire's projects Team on Vercel. A member of the Team first needs to authorize it. |
02ea6bc to
e28814f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🏷️ Type of PR
📋 Required Checks
📝 Description of the Changes
Wrapped the
getUserAuth()check inapp/_utils/redirectToHomeIfNotLogged.tswith atry-catchblock. Previously, if the local backend was unreachable, the auth check would fail and force a redirect to/, which forwarded to/homeand caused a continuous "500 Internal Error: fetch failed" loop. This fix ensures the app catches the connection error and prevents the infinite redirect loop.📋 Other Checks
📌 Reference Issues (Optional)
Closes #44
🔍 Anything else? (Optional)
This significantly improves the local development experience and offline state stability when the port 8080 backend is down.