mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix password entry after migrate
This commit is contained in:
parent
0133c26c53
commit
d940f6571d
@ -103,6 +103,19 @@ public func sendAuthorizationCode(accountManager: AccountManager<TelegramAccount
|
|||||||
|> map { sentCode in
|
|> map { sentCode in
|
||||||
return (.sentCode(sentCode), updatedAccount)
|
return (.sentCode(sentCode), updatedAccount)
|
||||||
}
|
}
|
||||||
|
|> `catch` { error -> Signal<(SendCodeResult, UnauthorizedAccount), MTRpcError> in
|
||||||
|
if error.errorDescription == "SESSION_PASSWORD_NEEDED" {
|
||||||
|
return account.network.request(Api.functions.account.getPassword(), automaticFloodWait: false)
|
||||||
|
|> mapToSignal { result -> Signal<(SendCodeResult, UnauthorizedAccount), MTRpcError> in
|
||||||
|
switch result {
|
||||||
|
case let .password(_, _, _, _, hint, _, _, _, _, _):
|
||||||
|
return .single((.password(hint: hint), account))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return .fail(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case _:
|
case _:
|
||||||
return .fail(error)
|
return .fail(error)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user