Skip to content

Commit

Permalink
Merge pull request #275 from boostcampwm2023/feat/274-sample-duplicat…
Browse files Browse the repository at this point in the history
…e-login

[Feat] 샘플 계정 중복 로그인 허용
  • Loading branch information
JoonSoo-Kim authored Dec 14, 2023
2 parents 7479e7e + a40cb88 commit b4c3b94
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 b4c3b94

Please sign in to comment.