Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,49 @@ services:
redis:
condition: service_healthy

app:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: backend-developer
restart: always
ports:
- '${APP_PORT}:5000'
env_file:
- .env.development
environment:
POSTGRES_HOST: postgres
REDIS_HOST: redis
volumes:
- ./:/app
- app_node_modules:/app/node_modules
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
command: npm run start:dev
develop:
watch:
- action: sync
path: .
target: /app
ignore:
- node_modules/
- dist/
- coverage/
- .git/
- .idea/
- .vscode/
- .env
- .env.*
- action: rebuild
path: package.json
- action: rebuild
path: package-lock.json

volumes:
postgres_data:
app_node_modules:
redis_data:
2 changes: 1 addition & 1 deletion src/modules/auth/interfaces/token-payload.interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { JwtPayload } from '@/common/interfaces/jwt-payload.interface';

export interface AccessTokenPayload extends JwtPayload {
jti: string;
jti?: string;
}

export interface RefreshTokenPayload {
Expand Down
5 changes: 4 additions & 1 deletion src/modules/auth/services/token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export class TokenService {
return payload;
}

async assertAccessTokenNotRevoked(userId: string, jti: string): Promise<void> {
async assertAccessTokenNotRevoked(userId: string, jti: string | undefined): Promise<void> {
if (!jti) {
return;
}
const isValid = await this.tokenRedisRepository.isAccessTokenValid(userId, jti);
if (!isValid) {
throw new UnauthorizedException('Token has been revoked');
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
"target": "ES2023",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
"@/*": ["./src/*"]
},
"incremental": true,
"skipLibCheck": true,
Expand Down
Loading