Open ManpreetSingh18 opened 1 week ago
Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our #24. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊
@Swarnendu0123 can you please review this PR?
I have mentioned it multiple times that we are going to use firebase for authentication. We don't need this.
@Swarnendu0123 I mentioned it before getting it assigned and you assigned it after my message stating the same Mongo db is mentioned in issue and also in the issue itself mongo db is mentioned . Additionally, the documentation includes MongoDB as well.
We will be using mongodb but not for the authentication. We will be using mongodb to store generated links and qrs. We will not store mongodb to store users.
@Swarnendu0123 ok, I will use Firebase. Now I am supposed to do everything mentioned in issue but in Firebase please check the video. You want that type of work in Firebase. Please confirm same?
I am planning to use the authentication service provided by firebase in this.
@Swarnendu0123 Here is the updated version of the code
Related Issue(s)
Description
This pull request aims to implement user authentication for our backend project, including user register and LogIn functionalities. The implementation includes creating a User model, setting up authentication routes, and using Zod for input validation.
Key Features:
Changes Made
Created
user-model
model in `models' with fields for username, email, and password, including necessary validations.Added environment variables for JWT secret and bcrypt salt rounds.
Implemented Register route (
POST /api/auth/register
) inroutes/auth-router.js
:Implemented Login route (
POST /api/auth/login
) inroutes/auth-router.js
:Implemented Zod in following folder
middleware/validate-middleware.js
validators/auth-validator.js
Implemented Login and register in
controllers/auth-controller.js
Define routes in
routes/auth-router.js
Screenshots (if applicable)
https://github.com/oxiton-foundation/click-metrics/assets/72294811/57b1b0ee-9d75-4a2e-8f26-bbf24eaae1ae
When user with same email already exist![Screenshot 2024-06-22 130624](https://github.com/oxiton-foundation/click-metrics/assets/72294811/727950b4-43c1-412e-a946-1f66fc02a368)
N/A
Checklist