Commit 6a70b9e5 authored by Jose Blaya's avatar Jose Blaya
Browse files

not needed anymore to disconnect the vpn before refresh the token

parent e94e5efa
......@@ -22,24 +22,11 @@ extension AccountProvider {
let migrationDone = Client.preferences.authMigrationSuccess
var forceRefreshToken = force
if migrationDone != true {
//Disconnect the VPN (if it's trying to reconnect)
forceRefreshToken = true
if Client.providers.vpnProvider.vpnStatus == .connecting ||
Client.providers.vpnProvider.vpnStatus == .disconnecting {
Client.providers.vpnProvider.disconnect({ [weak self] error in
guard let _ = error as? ClientError else {
self?.refreshAccount(force: forceRefreshToken)
return
}
})
} else {
refreshAccount(force: forceRefreshToken)
}
} else {
refreshAccount(force: forceRefreshToken)
}
refreshAccount(force: forceRefreshToken)
}
private func refreshAccount(force forceRefreshToken: Bool) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment