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

fix: 토큰 401 에러 해결 #562

Closed
wants to merge 1 commit into from
Closed

fix: 토큰 401 에러 해결 #562

wants to merge 1 commit into from

Conversation

m6z1
Copy link
Member

@m6z1 m6z1 commented Jan 23, 2025

📌𝘐𝘴𝘴𝘶𝘦𝘴

📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯

  • 리프레시 토큰 만료 시 401이 뜨고 로그인 뷰로 이동하지 않는 문제를 해결했습니다.

[ 로직 ]

  1. 스플래시에서 강제업데이트 확인
  • 강업 필요 : 강제 업데이트 다이얼로그 띄움
  • 강업 불필요 : 토큰이 필요한 내 프로필 (my-profile) api 호출
  1. 토큰 필요한 내 프로필 api 호출 시
  • success 시 (토큰 문제 없음) : isAutoLogin 여부 파악 후 홈으로 이동
  • fail 시 (토큰 문제 있음) : viewModel 프로퍼티에 error 라는 친구 추가해서 error 값 true 로 변경 및 로컬에 저장된 토큰 삭제, activity 에서 observing 후 true 값 들어왔을 시에 로그아웃 및 로그인 뷰로 이동

📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵

💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴

WebsosoAuthenticator 코드는 손 안댔고 일시적인 야매 방법으로 스플래시에서 api 통신하도록 구현했습니다.
땡스 투 산군...

@m6z1 m6z1 added 🏹 궁사 명지 웹소소 공주의 은밀한 사냥생활 🔨 [FIX] 버그를 수정합니다. 🚨[Emergency] 리뷰가 급하게 필요합니다. labels Jan 23, 2025
@m6z1 m6z1 requested a review from a team January 23, 2025 17:15
@m6z1 m6z1 self-assigned this Jan 23, 2025
@@ -91,11 +91,13 @@ class AuthRepository @Inject constructor(
refreshToken = response.refreshToken
response.authorization
}.getOrElse {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [ktlint] standard:no-empty-first-line-in-method-block reported by reviewdog 🐶
First line in a method block should not be empty

it.printStackTrace()
null
}
}


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [ktlint] standard:no-consecutive-blank-lines reported by reviewdog 🐶
Needless blank line(s)

}
}

/* 토큰 만료 확인용 - 추후 로직 수정 필요 */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [ktlint] standard:no-single-line-block-comment reported by reviewdog 🐶
Replace the block comment with an EOL comment

@m6z1
Copy link
Member Author

m6z1 commented Jan 23, 2025

develop 기반으로 브랜치따서 master 기반으로 다시 올릴 예정.

@m6z1 m6z1 closed this Jan 23, 2025
@m6z1 m6z1 deleted the feat/560 branch January 23, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏹 궁사 명지 웹소소 공주의 은밀한 사냥생활 🚨[Emergency] 리뷰가 급하게 필요합니다. 🔨 [FIX] 버그를 수정합니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hotfix: 토큰 401 에러 해결
1 participant