-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BE/#417] RefreshToken Redis 저장 #424
Conversation
const refreshToken = this.generateRefreshToken(user); | ||
return { access_token: accessToken, refresh_token: refreshToken }; | ||
|
||
if ((await this.cacheManager.get(user.user_hash)) === refreshtoken) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redis에 저장된 refesh token만 사용할 수 있게 되었네요
BE/src/login/login.service.ts
Outdated
await this.cacheManager.set( | ||
user.user_hash, | ||
refreshToken, | ||
60 * 60 * 24 * 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
환경변수로 하면 더 좋을 것 같네요~
const userPk = await this.checkAuth(id, userId); | ||
const decodedToken: any = jwt.decode(accessToken); | ||
if (decodedToken && decodedToken.exp) { | ||
await this.fcmHandler.removeRegistrationToken(decodedToken.userId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
유저 탈퇴할 때 registration token 삭제는 까먹었는데 넣어주셔서 감사합니다
이슈
체크리스트
고민한 내용
스크린샷