A comprehensive authentication system with HTTPS, Swagger documentation, user registration, login, token-based authentication, and session management.
- User registration with email and password
- User login with email and password
- Token-based authentication using JSON Web Tokens (JWT)
- Refresh token mechanism for enhanced security
- User session management
- Password hashing and salting for data security
- HTTPS support for secure communication
- Swagger API documentation for easy reference
You can install this project locally by following these steps:
# Clone the repository
git clone https://github.com/Arbtrage/Server-Token-Auth.git# Navigate to the project directory
cd Server-Token-Auth# Install server dependencies
npm install## Run Locally
npm run devServer:
- Node.js
- Express
- Typescript
- HTTPS for secure communication
- Swagger for API documentation
To run tests for this project, use the following command:
npm run testThis will execute the test suite and provide you with the test results.
- Register a new user using the
/auth/registerendpoint. - Log in with valid credentials using the
/auth/loginendpoint. - Obtain access and refresh tokens.
- Use the access token for authenticated requests.
- Use the refresh token to refresh the access token when it expires.
- Log out using the
/auth/logoutendpoint.
This project uses HTTPS to ensure secure communication between the client and server. To set up HTTPS, you will need SSL/TLS certificates. Follow these steps:
- Generate SSL/TLS certificates.
- Replace the certificate and key files in the server configuration.
- Update the server to listen on HTTPS.
This project includes Swagger API documentation to easily understand and interact with the API endpoints. You can access the Swagger documentation at https://localhost:3000/api-docs after starting the server.
This project is licensed under the MIT License - see the LICENSE file for details.