Authorization improvements

This commit is contained in:
Ilya Laktyushin 2024-04-22 22:17:35 +04:00
parent 1f8e9b568a
commit f199fe9641
2 changed files with 3 additions and 3 deletions

View File

@ -1040,7 +1040,7 @@ final class AuthorizationSequenceCodeEntryControllerNode: ASDisplayNode, UITextF
if let startsWith, !text.isEmpty { if let startsWith, !text.isEmpty {
let firstWord = text.components(separatedBy: " ").first ?? "" let firstWord = text.components(separatedBy: " ").first ?? ""
if !firstWord.isEmpty && !startsWith.hasPrefix(firstWord) { if !firstWord.isEmpty && !startsWith.hasPrefix(firstWord) {
if self.errorTextNode.alpha.isZero, text.count < 3 { if self.errorTextNode.alpha.isZero, text.count < 4 {
self.animateError(text: self.strings.Login_WrongPhraseError) self.animateError(text: self.strings.Login_WrongPhraseError)
} }
return false return false

View File

@ -1232,8 +1232,8 @@ public final class AuthorizationSequenceController: NavigationController, ASAuth
controllers.append(self.emailSetupController(number: number, appleSignInAllowed: self.appleSignInAllowed)) controllers.append(self.emailSetupController(number: number, appleSignInAllowed: self.appleSignInAllowed))
} }
if let previousCodeEntry, case let .confirmationCodeEntry(number, type, phoneCodeHash, timeout, nextType, _, _, _) = previousCodeEntry, usePrevious { if let previousCodeEntry, case let .confirmationCodeEntry(number, previousType, phoneCodeHash, timeout, nextType, _, _, _) = previousCodeEntry, usePrevious {
controllers.append(self.codeEntryController(number: number, phoneCodeHash: phoneCodeHash, email: self.currentEmail, type: type, nextType: nextType, timeout: timeout, previousCodeType: type, isPrevious: true, termsOfService: nil)) controllers.append(self.codeEntryController(number: number, phoneCodeHash: phoneCodeHash, email: self.currentEmail, type: previousType, nextType: nextType, timeout: timeout, previousCodeType: type, isPrevious: true, termsOfService: nil))
isGoingBack = true isGoingBack = true
} else { } else {
var previousCodeType: SentAuthorizationCodeType? var previousCodeType: SentAuthorizationCodeType?