Welcome to the Auth Service with JWT Backend project! This Node.js project is a sample implementation of an authentication service using JSON Web Tokens (JWT). It's designed to be used as part of a job interview process.
The Auth Service with JWT Backend project provides a secure authentication mechanism using JWTs. It's a great demonstration of building authentication features in a Node.js application. Do not remove local node_modules.
To run the Auth Service with JWT Backend project, follow these steps:
-
Set up your environment variables (e.g., database connection details, JWT secret) in a
.env
file based on the provided.env.example
. -
Run the application:
npm start
As a job candidate, your task is to enhance the Auth Service by adding a feature that checks if the current user is signed in or not. Follow the steps below to complete this task:
-
Before making any modifications, ensure that the project is running successfully.
-
Locate the file or files responsible for handling user authentication.
-
Identify the appropriate functions or middleware that handle user sign-in or authentication status.
-
Implement a feature that checks if the current user is signed in or not. You may choose to add an API endpoint, middleware, or modify existing authentication functions.
-
After making changes, run the project again to ensure that the project remains functional without any issues.
-
Optionally, document any changes made and reasons for those changes.
Good luck with your interview! If you have any questions, don't hesitate to reach out.
Happy coding!