[FEATURE] Add OAuth based Login & Fixed Credentials based Login.#63
Open
PR-1301 wants to merge 3 commits into
Open
[FEATURE] Add OAuth based Login & Fixed Credentials based Login.#63PR-1301 wants to merge 3 commits into
PR-1301 wants to merge 3 commits into
Conversation
|
@PR-1301 is attempting to deploy a commit to the anglenobida003-8112's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Kindly review this PR and allocate the maximum points possible based on the work completed. Also, I would request that the "good first issue" label be removed, as this issue involves multiple features and a fair amount of implementation effort which collectively make it more suitable for an intermediate-level to advanced level contribution. I believe it may have been labeled as a good first issue by mistake. Thank you for your time and consideration!! |
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
The PR enhances the authentication flow by integrating fully-featured Google And Twitter(X) OAuth. And also the credentials based login (Email& password login) was also broken which was also fixed and session management was also handled. Finally multiple UI/UX changes was made.(Error message, toast background). Added .env.example in both frontend and backend.
Closes
Issue #49
OAuth Issue:
Initially the Sign in with google/X was not working and irresponsive.
Backend (server/routes/auth.js):
Frontend (client/src/contexts/AuthContext.jsx):
Sign In with Google Success screenshot:

Sign In with Twitter(X) success screenshot:

Note: Kindly note the toast component which has no background, which was also fixed.
UI/UX changes:
Redesigned Login buttons:
Previously:
Password Strength meter:
Toast background fix:
Toaster was referencing undefined CSS variables --toast-bg and --toast-color, causing inconsistent backgrounds across pages.
Fix:
Specific Error Messages (server/routes/auth.js):
Improved Toast Notifications (client/src/contexts/AuthContext.jsx):
Session management:
The session was lost because only the JWT token was stored in localStorage. On every page navigation (including clicking "StackIt" logo), checkAuth() was called, setting user = null initially, which caused a flash of unauthenticated UI. If the API call failed for any transient reason, the user appeared logged out.
Fix:
Profile Icon on Landing page:
/profile Route Redirect:
Changes in User schema:
Other changes :
Old Navbar:
Steps to create Credentials:
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"to generate JWT_SECRET.I have tested it completed and it was successful.
Kindly review this PR and, allocate the maximum points based on the work completed. Thank you!!!