Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dodoinblue/sls-auth-service
A serverless authentication service
https://github.com/dodoinblue/sls-auth-service
Last synced: 5 days ago
JSON representation
A serverless authentication service
- Host: GitHub
- URL: https://github.com/dodoinblue/sls-auth-service
- Owner: dodoinblue
- License: mit
- Created: 2020-09-22T02:20:36.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-09-28T17:13:50.000Z (over 4 years ago)
- Last Synced: 2024-11-21T14:41:33.456Z (2 months ago)
- Language: TypeScript
- Size: 195 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Serverless Auth
## Setup DB
1. Create a `.env` file that contains following
```
DB_HOST=localhost
DB_USER=test
DB_PASSWORD=test
DB_SCHEMA=test
JWT_SECRET=secret
REFRESH_TOKEN_ENCRYPT_SECRET=notsafe
```2. Run migration command
```
env $(cat ./path/to/.env) npm run db:migrate
```## Run
### serverless offline
```
sls offline --prefix auth --noPrependStageInUrl
```### nodejs
```
env $(cat path/to/.env) npm run start:dev
```## API doc
1. Run `env $(cat path/to/.env) npm run start:dev`
2. Visit `http://localhost:3000/auth/docs/v1/`## Deploy
### AWS
```
sls deploy --stage yourStage --aws-profile yourAwsProfile
```## Goal
- [x] Create account
- [x] Login with username/password
- [x] Login with refresh token
- [x] Issue token with roles
- [ ] Verify email / phone number
- [x] Reset password flow
- [x] Account Info CRUD
- [x] Roles CRUD
- [ ] DynamoDB integration
- [ ] Test coverage
- [ ] Docker image
- [ ] Heroku
- [ ] Create account with invitation code
- [ ] Wechat/Apple/Google/Facebook/Alipay auth flow