mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Failure when finding a refresh token in a non OIDC login (#2377)
Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
@@ -122,6 +122,18 @@ class AuthenticationServiceProxy: AuthenticationServiceProxyProtocol {
|
||||
deviceId: deviceID)
|
||||
}
|
||||
|
||||
let refreshToken = try? await Task.dispatch(on: .global()) {
|
||||
try client.session().refreshToken
|
||||
}
|
||||
|
||||
if refreshToken != nil {
|
||||
MXLog.warning("Refresh token found for a non oidc session, can't restore session, logging out")
|
||||
_ = await Task.dispatch(on: .global()) {
|
||||
try? client.logout()
|
||||
}
|
||||
return .failure(.sessionTokenRefreshNotSupported)
|
||||
}
|
||||
|
||||
return await userSession(for: client)
|
||||
} catch {
|
||||
MXLog.error("Failed logging in with error: \(error)")
|
||||
|
||||
@@ -34,8 +34,8 @@ enum AuthenticationServiceError: Error {
|
||||
case slidingSyncNotAvailable
|
||||
case accountDeactivated
|
||||
case failedLoggingIn
|
||||
|
||||
case isOnWaitlist
|
||||
case sessionTokenRefreshNotSupported
|
||||
}
|
||||
|
||||
protocol AuthenticationServiceProxyProtocol {
|
||||
|
||||
Reference in New Issue
Block a user