abhijeetnishal / URLShortener

URL Shortener Deployed Link 👇🏻
https://urlsrtner.vercel.app
MIT License
37 stars 59 forks source link

[Feature] Implement Login/Signup with JWT Authentication (Server side) #16

Closed abhijeetnishal closed 3 months ago

abhijeetnishal commented 4 months ago

Description:

The current URL Shortener project lacks a user authentication mechanism, which prevents users from saving and managing their shortened URLs. To address this, we need to implement a login/signup system with JWT (JSON Web Token) authentication on the server-side. This will enable users to create an account, log in, and save their shortened URLs for future reference.

Requirements:

  1. User Registration:

    • Create a registration endpoint (v1/auth/signup) that accepts a username, email, and password.
    • Validate user input and store the user data in the MongoDB database.
  2. User Login:

    • Create a login endpoint (v1/auth/login) that accepts a username (or email) and password.
    • Verify the user credentials against the stored data in the MongoDB database.
    • Generate a JWT token upon successful login, which will be used for authentication.
  3. JWT Authentication:

    • Implement JWT token generation and verification using a library like jsonwebtoken.
    • Store the JWT token in the user's browser storage (e.g., localStorage).
    • Verify the JWT token on each request to protected endpoints.
  4. Error Handling:

    • Handle errors and exceptions properly, including invalid login credentials, expired tokens, and database errors, etc.

Technical Details:

Acceptance Criteria:

Estimated Time:

This issue is estimated to take around 2-3 days to complete, depending on the contributor's experience.

Mr-mahato commented 4 months ago

I'm interested in working on the open issue regarding the implementation of user authentication within the URL Shortener project. I have experience with Node.js, Express, MongoDB, and JWT token handling, which aligns well with the project's requirements.

I've reviewed the issue's description and requirements and feel confident that I can deliver a robust and secure authentication solution. I understand the need for proper error handling and am ready to address those aspects.

Would you be open to assigning this issue to me? I'm eager to contribute to the project and believe I have the skills necessary to complete this task within the estimated timeframe.

abhijeetnishal commented 4 months ago

Hey @Mr-mahato, I am assigning this issue to you. Best of luck.

Ansh101112 commented 4 months ago

Hello @abhijeetnishal I am also interested in solving this issue could you assign me this issue?

abhijeetnishal commented 4 months ago

Hey @Ansh101112, this issue is already assigned, you can contribute to other issues.

Mr-mahato commented 4 months ago

@abhijeetnishal Thanks for assigning me this issue , would you please don't mind me asking you a question . ie: should i start working on this issue or i have to work after 10th of may and then submit my pr.

abhijeetnishal commented 4 months ago

Hey @Mr-mahato, you can start working on this issue and because this issue will take time to finish and from tomorrow program is live so don't worry.

surendar-05 commented 4 months ago

Hey!! Assign this issue to me i want to work on this?

Mr-mahato commented 4 months ago

@abhijeetnishal I have seen that there is one issue #15 in this project where its mention to change the plain css to tailwind , will it be okay if i am using the tailwind css for this issue which i am assign for.

abhijeetnishal commented 4 months ago

Hey!! Assign this issue to me i want to work on this?

Hey @surendar-05, this issue is already assigned to @Mr-mahato. You can work on other issues, Good luck.

abhijeetnishal commented 4 months ago

@abhijeetnishal I have seen that there is one issue #15 in this project where its mention to change the plain css to tailwind , will it be okay if i am using the tailwind css for this issue which i am assign for.

Hey @Mr-mahato, this issue is for server side only you don't need to worry about it, I will create an another issue for client side once #15 is done.

Sahilll15 commented 3 months ago

@abhijeetnishal assign the client side integration work to me

abhijeetnishal commented 3 months ago

Hey @Mr-mahato, don't do force update on PR, if i will merge it to master branch it will changes the original code with our code, also you didn't pull the code from master as i mentioned. I have fixed the changes of master branch. But remember all these things for future references. Good luck

I am closing this issue as completed.

Mr-mahato commented 3 months ago

Screenshot from 2024-05-12 22-34-39 when i was trying to merge i was getting this error how to solve this one to merge with the master branch

abhijeetnishal commented 3 months ago

Screenshot from 2024-05-12 22-34-39 when i was trying to merge i was getting this error how to solve this one to merge with the master branch

This is merged conflict which happens when you change the same code from two branches, it's need to fix before merging either you can accept the incoming change or current change after this the conflict get resolved.

But with force update it update the current not the upcoming which is from master branch.

Mr-mahato commented 3 months ago

Thanks i have learn it how to solve this merging issue , onwards i will merge my branch and keep it uptodate then only make some changes and then create a PR.

abhijeetnishal commented 3 months ago

Thanks i have learn it how to solve this merging issue , onwards i will merge my branch and keep it uptodate then only make some changes and then create a PR.

Great 👏

Mr-mahato commented 3 months ago

I have also created the client side login and signup page if you allow me then i can contribute to that also.

abhijeetnishal commented 3 months ago

I have also created the client side login and signup page if you allow me then i can contribute to that also.

Hey @Mr-mahato, one issue is already there for login signup client side, I guess someone is already working on that.