Skip to content

Commit

Permalink
Add 2FA Authentication Method
Browse files Browse the repository at this point in the history
  • Loading branch information
zenkiet committed Sep 22, 2023
1 parent 83fc7f3 commit cb7d0c7
Show file tree
Hide file tree
Showing 10 changed files with 272 additions and 22 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
|| Implement Guard for all authentication method | [#65d1c61](https://github.com/Zenfection/project-management/commit/65d1c61e5a9e7a9576986c9fa81f9c68ce3799ab) | <img src="https://raw.githubusercontent.com/Zenfection/Image/master/2023/09/21-16-54-10-passportJS-300x300.png" title="" alt="passportJS300x300png" width="50">[passport](https://www.passportjs.org/) |
|| Intergrate Redis to save `refresh-token` instead of `client-cookie` | [#d101d84](https://github.com/Zenfection/project-management/commit/d101d84fd7e1ec6b531511e646ee6c2146fd2889) | [ioredis](https://github.com/luin/ioredis) |
|| Use cookie express store token via Redis | [#d060876](https://github.com/Zenfection/project-management/commit/d06087658fb38222bff39c49db6d114432a00fa7) | [express-session](https://github.com/expressjs/session)<br>[connect-redis](https://github.com/tj/connect-redis) |
| | Add 2FA Authentication Method | | |
| | Add 2FA Authentication Method | | [otplib](https://www.npmjs.com/package/otplib)<br>[qrcode](https://www.npmjs.com/package/qrcode) |
| | Add Google Authentication Method | | |
| | Build RBAC and ABAC Authorization with `roles`, `permissions`, `policies` | | |

Expand Down Expand Up @@ -55,4 +55,7 @@ JWT_REFRESH_TOKEN_TTL=86400
# SESSION
SESSION_SECRET=<YOUR SECRET>
# TFA SECRET
TFA_APP_NAME=<YOUR TFA NAME>
```
8 changes: 6 additions & 2 deletions server/.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ JWT_SECRET=secret
JWT_AUDIENCE=localhost:3000
JWT_ISSUER=localhost:3000
JWT_ACESSS_TOKEN_TTL=3600
JWT_REFRESH_TOKEN_TTL=86400\
JWT_REFRESH_TOKEN_TTL=86400

# SESSION SECRET
SESSION_SECRET=secret
SESSION_SECRET=secret


# TFA SECRET
TFA_APP_NAME=Zen_Task_Management
3 changes: 3 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@
"express-session": "^1.17.3",
"ioredis": "^5.3.2",
"nestjs-prisma": "^0.22.0",
"otplib": "^12.0.1",
"passport": "^0.6.0",
"passport-jwt": "^4.0.1",
"qrcode": "^1.5.3",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1"
},
Expand All @@ -57,6 +59,7 @@
"@types/node": "^18",
"@types/passport": "^1.0.12",
"@types/passport-jwt": "^3.0.9",
"@types/qrcode": "^1.5.2",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
Expand Down
145 changes: 135 additions & 10 deletions server/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb7d0c7

Please sign in to comment.