Skip to content
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

[Server/auth] accessToken 재발행 로직 구현, 로그아웃 로직 구현 #87

Merged
merged 10 commits into from
Nov 21, 2022

Conversation

soomanbaek
Copy link
Member

@soomanbaek soomanbaek commented Nov 21, 2022

Issues

🤷‍♂️ Description

refreshToken을 통해 accessToken을 재발행 하는 로직 구현
로그아웃시, user DB에서 refreshToken 제거

📝 Primary Commits

  • cookie에 저장된 refreshToken을 사용하기 위한 cookieParser 미들웨어 적용
  • refreshToken검증을 위한 Guard, Strategy 생성
  • DB에 저장된 refreshToken과 쿠키에 있는 refreshToken이 일치하는지 확인
  • 일치하면 accessToken 재발행

📷 Screenshots

  • 유효한 refreshToken
    1

    • 유효한 refreshToken 하지만 DB에 저장된 refreshToken과 일치하지 않음

      2
    • 유효한 refreshToken 하지만 user정보가 DB에 없음
      3

  • 유효하지 않은 refreshToken
    4

📒 Remarks

refreshToken 만료시간이 기존에 1시간 이었는데, 너무 작아서 100시간으로 수정했습니다!

@soomanbaek soomanbaek added 🌐 server 서버 작업 ✨ feature 기능 추가 labels Nov 21, 2022
@soomanbaek soomanbaek added this to the Week3 milestone Nov 21, 2022
@soomanbaek soomanbaek self-assigned this Nov 21, 2022
리펙토링 내용
- token 발행하는 로직 auth.service에서 따로 분리
@soomanbaek soomanbaek changed the title [Server/auth] accessToken 재발행 로직 구현 [Server/auth] accessToken 재발행 로직 구현, 로그아웃 로직 구현 Nov 21, 2022
@NaayoungKwon
Copy link
Collaborator

까다로운 로직인데 잘 구현한 것 같습니다. 고생많았습니다!

@NaayoungKwon NaayoungKwon merged commit 4bc30ba into dev-be Nov 21, 2022
@soomanbaek soomanbaek deleted the feature/auth branch November 21, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature 기능 추가 🌐 server 서버 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants