Catch both invalidPassword and usernameNotFound AccountErrors

This commit is contained in:
Angelo Stavrow 2020-08-17 13:20:21 -04:00
parent 8f6e5b9a0a
commit 216641029d
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -80,11 +80,15 @@ struct AccountLoginView: View {
The server could not be found. Please check that you've entered the information correctly and try again.
"""
isShowingAlert = true
} catch AccountError.invalidCredentials {
} catch AccountError.invalidPassword {
alertMessage = """
Invalid username or password. Please check that you've entered the information correctly and try again.
Invalid password. Please check that you've entered your password correctly and try logging in again.
"""
isShowingAlert = true
} catch AccountError.usernameNotFound {
alertMessage = """
Username not found. Did you use your email address by mistake?
"""
} catch {
alertMessage = "An unknown error occurred. Please try again."
isShowingAlert = true