TF-2871 Use refreshToken again when the new refreshToken is null
This commit is contained in:
@@ -36,15 +36,16 @@ class AuthenticationInterceptor: RequestInterceptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleRefreshToken(tokenRefreshManager: tokenRefreshManager) { tokenResponse in
|
handleRefreshToken(tokenRefreshManager: tokenRefreshManager) { tokenResponse in
|
||||||
guard let accessToken = tokenResponse.accessToken,
|
guard let accessToken = tokenResponse.accessToken else {
|
||||||
let refreshToken = tokenResponse.refreshToken else {
|
|
||||||
return completion(.doNotRetryWithError(error))
|
return completion(.doNotRetryWithError(error))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let newRefreshToken = tokenResponse.refreshToken ?? authenticationSSO.refreshToken
|
||||||
|
|
||||||
self.authentication = AuthenticationSSO(
|
self.authentication = AuthenticationSSO(
|
||||||
type: AuthenticationType.oidc,
|
type: AuthenticationType.oidc,
|
||||||
accessToken: accessToken,
|
accessToken: accessToken,
|
||||||
refreshToken: refreshToken,
|
refreshToken: newRefreshToken,
|
||||||
expireTime: "\(tokenResponse.expiresTime ?? 0)"
|
expireTime: "\(tokenResponse.expiresTime ?? 0)"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ class AuthenticationInterceptor: RequestInterceptor {
|
|||||||
token: accessToken,
|
token: accessToken,
|
||||||
tokenId: tokenResponse.tokenId,
|
tokenId: tokenResponse.tokenId,
|
||||||
expiredTime: "\(tokenResponse.expiresTime ?? 0)",
|
expiredTime: "\(tokenResponse.expiresTime ?? 0)",
|
||||||
refreshToken: refreshToken
|
refreshToken: newRefreshToken
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user