Skip to content

Commit

Permalink
♻️:: AuthRepositoryImpl saveToken함수 with로 객체 중복 호출개선
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaejongin12 committed Jun 4, 2024
1 parent 4eedfee commit 5e90eae
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ class AuthRepositoryImpl @Inject constructor(
}

override fun saveToken(data: AuthTokenModel): Flow<Unit> = flow {
localDataSource.setAccessToken(data.accessToken).first()
localDataSource.setAccessTokenExp(data.accessExpiredAt).first()
localDataSource.setRefreshToken(data.refreshToken).first()
localDataSource.setRefreshTokenExp(data.refreshExpiredAt).first()
localDataSource.setAuthority(data.authority).first()
with(localDataSource) {
setAccessToken(data.accessToken).first()
setAccessTokenExp(data.accessExpiredAt).first()
setRefreshToken(data.refreshToken).first()
setRefreshTokenExp(data.refreshExpiredAt).first()
setAuthority(data.authority).first()
}
}

override fun getAuthority(): Flow<Authority> {
Expand Down

0 comments on commit 5e90eae

Please sign in to comment.