Skip to content

Commit

Permalink
Setup Authentication SignIn / SignUp by  JWT
Browse files Browse the repository at this point in the history
Setup Authentication SignIn / SignUp by  JWT includes: access-token and refreshtoken
  • Loading branch information
zenkiet committed Sep 21, 2023
1 parent 1dac614 commit 78f749a
Show file tree
Hide file tree
Showing 31 changed files with 1,051 additions and 388 deletions.
17 changes: 11 additions & 6 deletions server/.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Docker Postgres
POSTGRES_USER=zenfection
POSTGRES_PASSWORD=123456
POSTGRES_DB=task-management

# This was inserted by `prisma init`:
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
# Docker Redis
REDIS_URL=redis://localhost:6379

# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
# Prisma
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?schema=public

DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?schema=public
# JWT TOKEN
JWT_SECRET=secret
JWT_AUDIENCE=localhost:3000
JWT_ISSUER=localhost:3000
JWT_ACESSS_TOKEN_TTL=3600
JWT_REFRESH_TOKEN_TTL=86400
40 changes: 23 additions & 17 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"vate": true,
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
Expand All @@ -20,47 +20,53 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/common": "^10.2.5",
"@nestjs/config": "^3.1.1",
"@nestjs/core": "^10.2.5",
"@nestjs/jwt": "^10.1.1",
"@nestjs/passport": "^10.0.2",
"@nestjs/platform-express": "^10.2.5",
"@nestjs/swagger": "^7.1.11",
"@prisma/client": "^5.3.1",
"bcrypt": "^5.1.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"nestjs-prisma": "^0.22.0",
"passport": "^0.6.0",
"passport-jwt": "^4.0.1",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1"
},
"devDependencies": {
"@compodoc/compodoc": "^1.1.21",
"@nestjs/cli": "^10.0.0",
"@nestjs/cli": "^10.1.17",
"@nestjs/mapped-types": "^2.0.2",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@nestjs/schematics": "^10.0.2",
"@nestjs/testing": "^10.2.5",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.86",
"@swc/jest": "^0.2.29",
"@types/bcrypt": "^5.0.0",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"@types/node": "^20.6.0",
"@types/jest": "^29.5.5",
"@types/node": "^20.6.3",
"@types/passport-jwt": "^3.0.9",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.42.0",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"eslint": "^8.49.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.4",
"prettier": "^3.0.0",
"jest": "^29.7.0",
"prettier": "^3.0.3",
"prisma": "^5.3.1",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.3"
"typescript": "^5.2.2"
},
"jest": {
"moduleFileExtensions": [
Expand Down

0 comments on commit 78f749a

Please sign in to comment.