Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authentication Service

Introduction

The Authentication Service handles user registration, login, and session management using JWT tokens. It supports role-based authorization and secure password management.

Installation

npm install express body-parser nodemon dotenv sequelize sequelize-cli mysql2 bcrypt jsonwebtoken

Setup

Database Configuration: Configure the database in config/config.json.

Sequelize Setup:

npx sequelize init
npx sequelize model:generate --name User --attributes email:string,password:string
 npx sequelize db:migrate

Password Hashing: Implemented using bcrypt in the User model.

Routes

##User Authentication:

POST /signup: Register a new user (with email and password).

POST /signin: Authenticate an existing user.

GET /isAuthenticated: Check if the user is authenticated.

GET /isAdmin: Check if the authenticated user has admin privileges.

Security

Password Encryption: Handled using bcrypt with a salt stored in the environment variables.

Token-Based Authentication: JWT tokens are used for session management and are sent in the headers as Bearer tokens.

Other Services Links

FlightSearchService

AirTicketBookingService

AuthService

ReminderService

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages