Skip to content

Commit

Permalink
refactor: do not overwrite issue_token and refresh_token when refresh…
Browse files Browse the repository at this point in the history
…_token is valid

Signed-off-by: Youngjin Jo <[email protected]>
  • Loading branch information
yjinjo committed Dec 11, 2024
1 parent 7b54ad5 commit 655a80a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cmd/other/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,7 @@ func executeUserLogin(currentEnv string) {
}

accessToken, refreshToken, newAccessToken, err := getValidTokens(currentEnv)
if err == nil && refreshToken != "" && !isTokenExpired(refreshToken) {
// Use existing valid refresh token
accessToken = newAccessToken
} else {
if err != nil || refreshToken == "" || isTokenExpired(refreshToken) {
// Get new tokens with password
password := promptPassword()
accessToken, refreshToken, err = issueToken(baseUrl, tempUserID, password, domainID)
Expand Down

0 comments on commit 655a80a

Please sign in to comment.