Skip to content

[BE-08] Implement JWT strategy, JwtAuthGuard, and CurrentUser decorator #573

@yusuftomilola

Description

@yusuftomilola

Overview

Set up the JWT authentication infrastructure: Passport JWT strategy, JWT guard, and the @CurrentUser decorator inside backend/contrib/.

Location

All work must be inside backend/contrib/src/auth/.

Acceptance Criteria

  • JwtStrategy extends PassportStrategy(Strategy) and validates JWT payload by fetching user from DB
  • JwtAuthGuard extends AuthGuard("jwt") from @nestjs/passport
  • @CurrentUser() parameter decorator extracts the authenticated user from req.user
  • AuthModule imports PassportModule and JwtModule.registerAsync using config service
  • Access token expiry is 15 minutes, refresh token expiry is 7 days

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions