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. |
NotShrirang
left a comment
There was a problem hiding this comment.
@Nayan-Kute21 let's wait till backend implements JWT auth
|
|
||
| // 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.
JWT implementation is in progress. So better to keep token based changes on hold for now.
|
@Nayan-Kute21 I just merged another PR into the |
NotShrirang
left a comment
There was a problem hiding this comment.
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. |
MyContextto manage authentication and user profile state, persisting both inlocalStorageso users stay logged in after refresh.registerAPIwas refactored to accept auserDataobject and send the correct payload to the updated/users/createendpoint.contextandlocalStorage, marking them as authenticated, and redirecting to the dashboard.ProtectedRouteandPublicRoute) were also updated to read from context instead of static API checks, ensuring consistent authentication handling throughout the app.