-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from KUSITMS-29th-TEAM-B/refactor/flight-145
refactor : 토큰 로직 수정(#145)
- Loading branch information
Showing
12 changed files
with
77 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
...gang/apimodule/domain/user/application/service/handler/config/AuthHandlerConfiguration.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...le/src/main/kotlin/com/bamyanggang/domainmodule/domain/user/repository/TokenRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package com.bamyanggang.domainmodule.domain.user.repository | ||
|
||
import com.bamyanggang.domainmodule.domain.user.aggregate.Token | ||
import java.util.UUID | ||
|
||
interface TokenRepository { | ||
fun save(token: Token) | ||
fun findByValue(value: String): Token | ||
fun deleteByValue(token: Token) | ||
fun deleteByValue(value: String) | ||
fun findByUserId(userId: UUID): Token? | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/user/service/TokenModifier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.bamyanggang.domainmodule.domain.user.service | ||
|
||
import com.bamyanggang.domainmodule.domain.user.aggregate.Token | ||
import com.bamyanggang.domainmodule.domain.user.repository.TokenRepository | ||
import java.util.* | ||
|
||
class TokenModifier( | ||
private val tokenRepository: TokenRepository | ||
) { | ||
|
||
fun modifyToken( | ||
userId: UUID, | ||
refreshToken: String, | ||
newRefreshToken: String | ||
): Token { | ||
return tokenRepository | ||
.findByValue(refreshToken) | ||
.update( | ||
userId = userId, | ||
refreshToken = newRefreshToken | ||
) | ||
.also { tokenRepository.save(it) } | ||
} | ||
|
||
} |
15 changes: 0 additions & 15 deletions
15
...in-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/user/service/TokenReader.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters