fix: use v9 store status for deregistration login

This commit is contained in:
2026-08-31 16:36:20 +08:00
parent 4444d328df
commit b8343ad9eb
8 changed files with 194 additions and 11 deletions
@@ -290,6 +290,8 @@ final class LoginViewController: BaseViewController {
completeLogin(with: response, account: account)
case .needsAccountSelection:
break
case let .needsDeregistrationConfirmation(confirmation):
presentDeregistrationLoginConfirmation(confirmation)
}
} catch is CancellationError {
return
@@ -335,6 +337,31 @@ final class LoginViewController: BaseViewController {
}
}
private func presentDeregistrationLoginConfirmation(_ confirmation: DeregistrationLoginConfirmation) {
let alert = makeDeregistrationLoginAlert(
account: confirmation.account,
onConfirm: { [weak self] in
self?.confirmDeregistrationLogin(confirmation)
}
)
present(alert, animated: true)
}
private func confirmDeregistrationLogin(_ confirmation: DeregistrationLoginConfirmation) {
Task {
showLoading()
defer { hideLoading() }
do {
let response = try await viewModel.confirmDeregistrationLogin(confirmation, authAPI: authAPI)
completeLogin(with: response, account: confirmation.account)
} catch is CancellationError {
return
} catch {
showToast(error.localizedDescription)
}
}
}
private func completeLogin(with response: V9AuthResponse, account: AccountSwitchAccount) {
AuthSessionHelper.completeLogin(
with: response,