Skip to content

Conversation

@bongbak
Copy link
Contributor

@bongbak bongbak commented Nov 24, 2025

📌 PR 제목

9주차 미션 수행했습니다!

  • JWT 토큰 인증 테스트 과정이 이게 맞는지
  • Login 구현 시 User.kt 를 이렇게 구성해도 되는건지
  • LockerFragment 의 로그인 유지 안되는 건 스스로 개선해야하는지
    세 가지 궁금증이 있습니다...!

마지막 스터디에 스스로 공부해보고 고쳐갈 것 같습니다!(9주차 스터디를 못가서요... 죄송합니다!!)

✅ 변경 사항

  • SignUp 구현
  • Login 구현
  • 토큰 인증 테스트

📷 영상 및 스크린샷

umc9.mp4

bongbak added 25 commits October 9, 2025 19:18
탭 레이아웃 저장한 곡, 음악파일, 저장 앨범 프래그먼트 추가 및 연결 기능 구현
@bongbak bongbak self-assigned this Nov 24, 2025
Copy link
Member

@yangjiae12 yangjiae12 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

binding.mainPlayerCl.setOnClickListener {
val intent = Intent(this, SongActivity::class.java)
}
checkJwt()
Copy link
Member

Choose a reason for hiding this comment

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

현재 사용자가 하단 미니플레이어를 누르면 토큰 검사를 하게 되어 있는데 앱이 켜질 때 토큰을 검사하도록 SplashActivity에 토큰을 검사하도록 코드를 추가하고 자동 로그인까지 구현해 보셔도 좋을 것 같습니다!

Comment on lines +48 to +51
private fun getJwt(): Int {
val spf = activity?.getSharedPreferences("auth", AppCompatActivity.MODE_PRIVATE)
return spf!!.getInt("jwt", 0)
}
Copy link
Member

Choose a reason for hiding this comment

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

코드를 보니 onStart()에서 initViews()를 호출해서 로그인 상태를 체크하려고 하신 건 아주 잘하셨습니다! 그런데 JWT 토큰을 가져오는 부분에서 자료형 실수가 있어서 로그인이 풀린 것처럼 보이는 것 같습니다

JWT 토큰은 긴 영어 문자열이기 때문에 Int가 아니라 String으로 다뤄야 하기 때문에 getString으로 바꾸신다면 정상적으로 동작할 것 같습니다!

import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

const val BASE_URL="http://43.200.73.115:8080/"
Copy link
Member

Choose a reason for hiding this comment

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

작성하신 BASE_URL을 보니 IP 주소를 상수에 그대로 적으셨는데, 프로젝트를 할 때는 보통 저렇게 하지 않습니다. Git 같은 곳에 올릴 때 서버가 노출되면 보안상 좋지 않기 때문에 보통은 local.properties라는 파일에 숨겨두고, build.gradle을 통해 불러오는 방식을 씁니다! 나중에 한번 찾아보시면 좋을 것 같아요~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants