Skip to content

Commit

Permalink
authentication success!
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Nov 13, 2023
1 parent 19a46d8 commit 1debb9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import {
Get,
Post,
UseGuards,
UsePipes,
ValidationPipe,
} from '@nestjs/common';

import { AuthService } from './auth.service';
Expand All @@ -22,7 +20,6 @@ export class AuthController {
}

@Post('/login')
@UsePipes(ValidationPipe)
async login(@Body() authLoginUserDto: AuthLoginUserDto) {
return await this.awsCognitoService.authenticateUser(authLoginUserDto);
}
Expand Down
6 changes: 3 additions & 3 deletions src/auth/passport/jwt.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
ignoreExpiration: false,
_audience: process.env.AWS_COGNITO_COGNITO_CLIENT_ID,
issuer: process.env.AWS_COGNITO_AUTHORITY,
_audience: process.env.AWS_COGNITO_CLIENT_ID,
issuer: `https://cognito-idp.ap-northeast-2.amazonaws.com/${process.env.AWS_COGNITO_USER_POOL_ID}`,
algorithms: ['RS256'],
secretOrKeyProvider: passportJwtSecret({
cache: true,
rateLimit: true,
jwksRequestsPerMinute: 5,
jwksUri: process.env.AWS_COGNITO_AUTHORITY + '/.well-known/jwks.json',
jwksUri: `https://cognito-idp.ap-northeast-2.amazonaws.com/${process.env.AWS_COGNITO_USER_POOL_ID}/.well-known/jwks.json`,
}),
});
}
Expand Down

0 comments on commit 1debb9f

Please sign in to comment.