-
Notifications
You must be signed in to change notification settings - Fork 23
feat:integrate register api fixes #5 #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat:integrate register api fixes #5 #18
Conversation
@Nayan-Kute21 is attempting to deploy a commit to the notshrirang's projects Team on Vercel. A member of the Team first needs to authorize it. |
can you also add the tag of hacktoberfest accepted before merging this pr. |
@Nayan-Kute21 Please add a description to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nayan-Kute21 let's wait till backend implements JWT auth
src/pages/RegisterPage.jsx
Outdated
|
||
// Generate a temporary token for demo purposes | ||
// In a real app, the registration API should return a token | ||
const tempToken = `temp_${Date.now()}_${userData.email}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Prathamesh-007 please have a look at this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JWT implementation is in progress. So better to keep token based changes on hold for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raised a fix.
@Nayan-Kute21 I just merged another PR into the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve the merge conflict.
caf7059
to
5654f39
Compare
@NotShrirang resolved the conflict. I also noticed a rece condition in the registration flow. replaced 'navigate' with 'window.location.replace` to cater it in the registration page. let me know if there are any other changes to be made. |
MyContext
to manage authentication and user profile state, persisting both inlocalStorage
so users stay logged in after refresh.registerAPI
was refactored to accept auserData
object and send the correct payload to the updated/users/create
endpoint.context
andlocalStorage
, marking them as authenticated, and redirecting to the dashboard.ProtectedRoute
andPublicRoute
) were also updated to read from context instead of static API checks, ensuring consistent authentication handling throughout the app.