Welcome the the Authentication Service of AIRNET Airline Flight booking service
-
Clone the repository:
git clone https://github.com/your-username/authentication-service.git
-
Install dependencies:
npm install
-
Configure environment variables:
PORT= JWT_KEY=
Edit the
.env
file with your configuration.
-
Start the server:
npm start
-
Use the following endpoints for authentication:
- **POST /signup:** Register a new user.
- **POST /signin:** Sign in with email and password.
- **GET /isAuthenticated:** Check if the user is authenticated.
- **GET /isAdmin:** Check if the user is an admin.
- **POST /addEmployee:** Add a new employee (admin only).
- **POST /generateOtp:** Generate OTP for password reset.
- **POST /resetPassword:** Reset user password using OTP.
- Configure environment variables in the `.env` file.
- Set up database connection details, JWT secret, etc.
- JWT authentication is used for user authentication.
- Generate access tokens upon successful sign-in.
- Errors are handled gracefully with appropriate status codes and error messages.
- Passwords are hashed before storing in the database.
- JWT tokens are securely generated and verified.