Nest auth API: Manage users login and registration.
Supports user roles and permissions. Authenticated routes can be protected by role-based access control and authorization. Local strategy and JWT strategy.
$ npm install# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prodPORT=3000
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=your_postgres_username
DB_PASSWORD=your_postgres_password
DB_DATABASE=your_db_name
JWT_SECRET=token_secret
JWT_EXPIRES_IN=1m
JWT_REFRESH_SECRET=refreshtoken_secret
JWT_REFRESH_EXPIRES_IN=2m
BCRYPT_SALT_ROUNDS=12Expires times are in minutes for testing purposes. Modify JWT_EXPIRES_IN and JWT_REFRESH_EXPIRES_IN to fit your needs.
Suggested values:
JWT_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=5d
Role permission: use JwtAuthGuard and RolesGuard to access the endpoints (implemented in admin and roles controllers).
- Author - Alan Löffler
nest-auth-api is MIT licensed.