Skip to content
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

🚀 [feat] : setting up routes for authentication #9

Merged
merged 31 commits into from
Dec 22, 2023
Merged

🚀 [feat] : setting up routes for authentication #9

merged 31 commits into from
Dec 22, 2023

Conversation

Bismay5467
Copy link
Collaborator

@Bismay5467 Bismay5467 commented Dec 19, 2023

Fixes #7
Partially fixes #8

DONE :

  • setup a basic page for registration, sign in, sign out
  • setup routes to handle registration of new user, login and logout
  • JWT based authentication (stored in cookies)
  • forget password page (The password can be reset by clicking on the link sent in the email)

TODO :

  • OAuth using next-auth (a NPM lib) [though I need to figure out how to handle things in production. It seems google has some strict verification rules for external OAuth]

@Shubham-Rasal I am facing some issue in validating password in the sign in route. I need to have a look at the issue. I would suggest not to merge this PR right now.

@VaibhavNITK you may start styling these pages by pulling this branch in your machine.

@Shubham-Rasal @VaibhavNITK feel free to review this PR and post your thoughts in the comment section.

Copy link

vercel bot commented Dec 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
exam-archive ❌ Failed (Inspect) Dec 21, 2023 7:15pm

@Bismay5467
Copy link
Collaborator Author

image

@Shubham-Rasal

@Shubham-Rasal
Copy link
Owner

It is a problem only with OAuth or even with the plain old JWT-based auth as well? Also error logs with possible places the error might be occurring can be really useful.

@Bismay5467
Copy link
Collaborator Author

It is a problem only with OAuth or even with the plain old JWT-based auth as well? Also error logs with possible places the error might be occurring can be really useful.

This is a problem that I am facing in the database section. It has nothing to do with the authentication part. You may make a API call to the sign in route (POST) with the apt request body to reproduce the error.

@Bismay5467
Copy link
Collaborator Author

Bismay5467 commented Dec 19, 2023

@Shubham-Rasal

The API request will look something similar to this

curl --location 'http://localhost:3000/api/auth/signIn' \
--header 'Content-Type: application/json' \
--data-raw '{
    
    "username": "[email protected]",
    "password": "qwer1@"
}'

@Bismay5467
Copy link
Collaborator Author

Bismay5467 commented Dec 21, 2023

@Shubham-Rasal I am yet to commit the reset password page. Not yet figured out how to fix the rendering issue. Right now, I am working on it. Beside that, other features seem to working as expected. Can you please confirm once ? I might have missed some edge cases? Or any vulnerability?

@Bismay5467
Copy link
Collaborator Author

Bismay5467 commented Dec 21, 2023

@Shubham-Rasal I've come up with a workaround for the rendering problem, however I'm sure it's not the ideal solution. Let's see if @VaibhavNITK can offer any advice on how to handle it. The password reset page has been committed by me.

@Shubham-Rasal @VaibhavNITK I would advise you everyone to test each of the parts and APIs in this PR and let me know what you think. Any and all comments would be much valued.

@VaibhavNITK There is a TODO about creating a 403 error page in the reset page (under the auth folder).

@Shubham-Rasal I think I've finished my part. If there are no modifications required, you can merge this PR right away. In a later PR, I would implement the OAuth based authentication. For now, let's just stay with the current JWT based authentication

@Bismay5467 Bismay5467 changed the title ⚒️ [WIP] : setting up routes for authentication 🚀 [feat] : setting up routes for authentication Dec 21, 2023
@Shubham-Rasal Shubham-Rasal merged commit 01067ab into Shubham-Rasal:master Dec 22, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

frontend landing page authentication mongodb
2 participants