-
Notifications
You must be signed in to change notification settings - Fork 268
fix(auth): adds missing EMAIL_NOT_FOUND error code #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
54b8114
cef91ac
77177c7
a957589
eb0d2a0
05378ef
4121c50
a8d6e83
36a9930
14532ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -450,6 +450,7 @@ const ( | |||
// Backend-generated error codes | ||||
configurationNotFound = "CONFIGURATION_NOT_FOUND" | ||||
emailAlreadyExists = "EMAIL_ALREADY_EXISTS" | ||||
emailNotFound = "EMAIL_NOT_FOUND" | ||||
invalidDynamicLinkDomain = "INVALID_DYNAMIC_LINK_DOMAIN" | ||||
phoneNumberAlreadyExists = "PHONE_NUMBER_ALREADY_EXISTS" | ||||
tenantNotFound = "TENANT_NOT_FOUND" | ||||
|
@@ -468,6 +469,11 @@ func IsEmailAlreadyExists(err error) bool { | |||
return hasAuthErrorCode(err, emailAlreadyExists) | ||||
} | ||||
|
||||
// IsEmailNotFound checks if the given error was due to the user record corresponding to the email not being found. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets also add a test case at firebase-admin-go/auth/user_mgt_test.go Line 510 in 4121c50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a test to
bojeil-google marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
func IsEmailNotFound(err error) bool { | ||||
return hasAuthErrorCode(err, emailNotFound) | ||||
} | ||||
|
||||
// IsInsufficientPermission checks if the given error was due to insufficient permissions. | ||||
// | ||||
// Deprecated. Always returns false. | ||||
|
@@ -1298,6 +1304,11 @@ var serverError = map[string]*authError{ | |||
message: "user with the provided email already exists", | ||||
authCode: emailAlreadyExists, | ||||
}, | ||||
"EMAIL_NOT_FOUND": { | ||||
code: internal.NotFound, | ||||
message: "no user record found for the given email", | ||||
bojeil-google marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
authCode: emailNotFound, | ||||
}, | ||||
"INVALID_DYNAMIC_LINK_DOMAIN": { | ||||
code: internal.InvalidArgument, | ||||
message: "the provided dynamic link domain is not configured or authorized for the current project", | ||||
|
Uh oh!
There was an error while loading. Please reload this page.