Skip to content

Commit

Permalink
feat: 샘플 계정 중복 로그인 허용
Browse files Browse the repository at this point in the history
- 아이디가 sample일 시 리프레시 토큰 검사를 하지 않고 중복 로그인을 허용하도록 수정
  • Loading branch information
JoonSoo-Kim committed Dec 14, 2023
1 parent 7479e7e commit a40cb88
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions BE/src/auth/guard/auth.jwt-guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ export class JwtAuthGuard extends NestAuthGuard("jwt") {
: request.ip;
const accessToken = request.headers.authorization.split(" ")[1];

const accessTokenBody = jwt.verify(
accessToken,
process.env.JWT_SECRET,
) as jwt.JwtPayload;

if (accessTokenBody.userId === "sample") {
return true;
}

const refreshToken = await this.redisClient.get(request.user.userId);

const refreshTokenBody = jwt.verify(
Expand Down

0 comments on commit a40cb88

Please sign in to comment.