gpt4 book ai didi

ios - Firebase 登录的授权错误列表

转载 作者:可可西里 更新时间:2023-11-01 05:04:23 27 4
gpt4 key购买 nike

我需要的是针对所有不同登录错误的 FirebaseAuthentication 代码的完整列表,以及所有这些错误的列表。到目前为止,我已经通过反复试验找到了一些,但不能冒错过一些的风险。

我正在使用 Firebase 简单登录来使用电子邮件/密码、facebook、twitter 以及匿名登录。显然,使用这么多登录方法,用户可能无法正确登录的原因有很多(电子邮件格式不正确、未输入密码等)。目前我正在使用这段代码:

... authenticateWithDictionary method

completion:^(NSError * error, id<PUser> user) {

if (!error) {

[self loginButtonPressed:Nil];
}
else {

[UIView alertWithTitle:bErrorTitle withError:error];
}

唯一的问题是我不再收到如下所示的错误:

**(Error Code: EMAIL_TAKEN) The specified email address is already in use.**

这很好让我知道测试中出了什么问题,但是一旦应用程序上线,我会希望单独的消息a) 看起来更整洁b) 让用户知道为什么会出现这个错误

到目前为止,通过反复试验,我得出了以下结论:

错误代码

-5      INVALID EMAIL - empty or incorrect format
-6 INVALID PASSWORD
-9 EMAIL TAKEN

一旦我有了完整的列表,我将使用 switch 语句来正确处理它们

有谁知道错误代码和错误的完整列表,这样我就可以将它们全部考虑在内,而不必考虑所有可能意味着我错过一个的选项

最佳答案

您可以在 FirebaseAuth.framework 中的 FIRAuthErrorCode 枚举下找到所有 firebase 身份验证错误代码和解释

/*
Indicates a validation error with the custom token.
*/
FIRAuthErrorCodeInvalidCustomToken = 17000,

/*
Indicates the service account and the API key belong to different projects.
*/
FIRAuthErrorCodeCustomTokenMismatch = 17002,

/*
Indicates the IDP token or requestUri is invalid.
*/
FIRAuthErrorCodeInvalidCredential = 17004,

/*
Indicates the user's account is disabled on the server.
*/
FIRAuthErrorCodeUserDisabled = 17005,

/*
Indicates the administrator disabled sign in with the specified identity provider.
*/
FIRAuthErrorCodeOperationNotAllowed = 17006,

/*
Indicates the email used to attempt a sign up is already in use.
*/
FIRAuthErrorCodeEmailAlreadyInUse = 17007,

/*
Indicates the email is invalid.
*/
FIRAuthErrorCodeInvalidEmail = 17008,

/*
Indicates the user attempted sign in with a wrong password.
*/
FIRAuthErrorCodeWrongPassword = 17009,

/*
Indicates that too many requests were made to a server method.
*/
FIRAuthErrorCodeTooManyRequests = 17010,

/*
Indicates the user account was not found.
*/
FIRAuthErrorCodeUserNotFound = 17011,

/*
Indicates account linking is required.
*/
FIRAuthErrorCodeAccountExistsWithDifferentCredential = 17012,

/*
Same enum as @c FIRAuthErrorCodeAccountExistsWithDifferentCredential ,
but with incorrect spelling. Only exists for backwards compatiblity.
*/
FIRAuthErrrorCodeAccountExistsWithDifferentCredential = 17012,

/*
Indicates the user has attemped to change email or password more than 5 minutes after
signing in.
*/
FIRAuthErrorCodeRequiresRecentLogin = 17014,

/*
Indicates an attempt to link a provider to which the account is already linked.
*/
FIRAuthErrorCodeProviderAlreadyLinked = 17015,

/*
Indicates an attempt to unlink a provider that is not linked.
*/
FIRAuthErrorCodeNoSuchProvider = 17016,

/*
Indicates user's saved auth credential is invalid, the user needs to sign in again.
*/
FIRAuthErrorCodeInvalidUserToken = 17017,

/*
Indicates a network error occurred (such as a timeout, interrupted connection, or
unreachable host). These types of errors are often recoverable with a retry. The @c
NSUnderlyingError field in the @c NSError.userInfo dictionary will contain the error
encountered.
*/
FIRAuthErrorCodeNetworkError = 17020,

/*
Indicates the saved token has expired, for example, the user may have changed account
password on another device. The user needs to sign in again on the device that made this
request.
*/
FIRAuthErrorCodeUserTokenExpired = 17021,

/*
Indicates an invalid API key was supplied in the request.
*/
FIRAuthErrorCodeInvalidAPIKey = 17023,

/*
Indicates that an attempt was made to reauthenticate with a user which is not the current
user.
*/
FIRAuthErrorCodeUserMismatch = 17024,

/*
Indicates an attempt to link with a credential that has already been linked with a
different Firebase account
*/
FIRAuthErrorCodeCredentialAlreadyInUse = 17025,

/*
Indicates an attempt to set a password that is considered too weak.
*/
FIRAuthErrorCodeWeakPassword = 17026,

/*
Indicates the App is not authorized to use Firebase Authentication with the
provided API Key.
*/
FIRAuthErrorCodeAppNotAuthorized = 17028,

/*
Indicates the OOB code is expired.
*/
FIRAuthErrorCodeExpiredActionCode = 17029,

/*
Indicates the OOB code is invalid.
*/
FIRAuthErrorCodeInvalidActionCode = 17030,

/*
Indicates that there are invalid parameters in the payload during a "send password reset
* email" attempt.
*/
FIRAuthErrorCodeInvalidMessagePayload = 17031,

/*
Indicates that the sender email is invalid during a "send password reset email" attempt.
*/
FIRAuthErrorCodeInvalidSender = 17032,

/*
Indicates that the recipient email is invalid.
*/
FIRAuthErrorCodeInvalidRecipientEmail = 17033,

/*
Indicates an error occurred while attempting to access the keychain.
*/
FIRAuthErrorCodeKeychainError = 17995,

/*
Indicates an internal error occurred.
*/
FIRAuthErrorCodeInternalError = 17999,

关于ios - Firebase 登录的授权错误列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27420176/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com