fix(auth): improve cross-browser login resilience and sync with backend updates - #84
Open
Shubham15986 wants to merge 1 commit into
Open
Conversation
- Add fallback JWT username decoding in userInfo.js to prevent 'User not found in local storage' errors - Update Google login button in Glogin.jsx to use semantic button with error handling and toasts for Safari/Firefox popup compatibility - Gracefully handle 404 profile lookups in Login.jsx and Layout.jsx by redirecting to /profile/edit for completion - Ensure status is reset to typing across all auth flows in AuthContext.js - Remove broken Google font link in public/index.html causing MIME type mismatch
|
@Shubham15986 is attempting to deploy a commit to the RECursion's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Description
This PR resolves cross-browser login responsiveness issues (particularly on Firefox and Safari) and aligns frontend authentication and profile handling with recent backend security updates (
commit 282e3f8: Patched IDOR in Google Loginandcommit 8eb4b70: JWT permission restrictions).Context & Root Cause Analysis
username = email.split('@')[0].User not found in local storagewhenlocalStorage.getItem("user")was missing or desynced, leaving the login form stuck in asubmitting(disabled) state.<div>elements were blocked by Safari and Firefox's Enhanced Tracking Protection / popup policies without triggering error callbacks./profile/edit.public/index.html(Mullishinstead ofMulish) that triggered a stylesheet MIME type mismatch error.Key Changes
src/api/userInfo.js&src/context/AuthContext.js):authTokensif theuserobject inlocalStorageis missing or incomplete.statusis reliably reset to"typing"across all authentication success and error paths.src/components/GoogleLogin/Glogin.jsx):<button type="button">to ensure browser user-activation trust.onErrorhandler and toast alerts for popup blocking and network failures.src/components/Login.jsx&src/components/Layout.jsx):/profile/editto complete required fields rather than being logged out.public/index.html):MullishGoogle Font link.Testing & Verification
/profile/editon new user registration/login (404 profile).