-
Notifications
You must be signed in to change notification settings - Fork 945
Align recaptcha error codes with android #7064
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
Conversation
|
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (133,893 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
packages/auth/src/api/errors.ts
Outdated
@@ -216,7 +216,7 @@ export const SERVER_ERROR_MAP: Partial<ServerErrorMap<ServerError>> = { | |||
[ServerError.BLOCKING_FUNCTION_ERROR_RESPONSE]: AuthErrorCode.INTERNAL_ERROR, | |||
|
|||
// Recaptcha related errors. | |||
[ServerError.INVALID_RECAPTCHA_SCORE]: AuthErrorCode.RECAPTCHA_CHECK_FAILED, | |||
[ServerError.INVALID_RECAPTCHA_SCORE]: AuthErrorCode.CAPTCHA_CHECK_FAILED, | |||
[ServerError.RECAPTCHA_NOT_ENABLED]: AuthErrorCode.RECAPTCHA_NOT_ENABLED, | |||
[ServerError.MISSING_RECAPTCHA_TOKEN]: AuthErrorCode.INTERNAL_ERROR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we expose these errors too, instead of INTERNAL_ERROR?
Also, there is no INVALID_RECAPTCHA_ENFORCEMENT_STATE anymore/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reopening to check if we can expose these error codes directly instead of INTERNAL_ERROR.
[ServerError.INVALID_RECAPTCHA_VERSION]: AuthErrorCode.INVALID_RECAPTCHA_VERSION,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the recaptcha errors right? Yeah, they're exposed. See the auth.api.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, why are we mapping - [ServerError.MISSING_RECAPTCHA_TOKEN]: AuthErrorCode.INTERNAL_ERROR,
to INTERNAL_ERROR instead of AuthErrorCode.MISSING_RECAPTCHA_TOKEN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I completely missed the right part. Just updated. Thanks for pointing this out.
packages/auth/src/api/errors.ts
Outdated
@@ -216,7 +216,7 @@ export const SERVER_ERROR_MAP: Partial<ServerErrorMap<ServerError>> = { | |||
[ServerError.BLOCKING_FUNCTION_ERROR_RESPONSE]: AuthErrorCode.INTERNAL_ERROR, | |||
|
|||
// Recaptcha related errors. | |||
[ServerError.INVALID_RECAPTCHA_SCORE]: AuthErrorCode.RECAPTCHA_CHECK_FAILED, | |||
[ServerError.INVALID_RECAPTCHA_SCORE]: AuthErrorCode.CAPTCHA_CHECK_FAILED, | |||
[ServerError.RECAPTCHA_NOT_ENABLED]: AuthErrorCode.RECAPTCHA_NOT_ENABLED, | |||
[ServerError.MISSING_RECAPTCHA_TOKEN]: AuthErrorCode.INTERNAL_ERROR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reopening to check if we can expose these error codes directly instead of INTERNAL_ERROR.
[ServerError.INVALID_RECAPTCHA_VERSION]: AuthErrorCode.INVALID_RECAPTCHA_VERSION,
No description provided.