-
Notifications
You must be signed in to change notification settings - Fork 213
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
v3 breaks consistent error handling #709
Comments
Apologies, an amendment to the bug report. Errors are not coming out meaningfully on Android at all. During testing I patched Here is the patch that makes the error detectable on Android:
So as with IOS, we really need the error returned to include BOTH the API |
Thanks for the bug report @rick-lannan-upgrowth, and for your patience - we've had a support ticket raised internally as well and @poovamraj will be taking a look at this next week 👍🏻 |
@rick-lannan-upgrowth thanks for raising this. Answering your specific problems
But to get more idea on the first point, can you point out to other error codes that have been similar in platforms that are causing issue in real world scenario. |
Hi, Glad to hear you are working on this issue. Do you have any time frames for when we could expect a release? Here's the extra info you requested:
To answer your last question it's really just the CANCEL event and the API error response that is important for us as we have user friendly error messaging if a registration or login fails. We also have built some improvements to email verification process on Android that automatically completes a registration after the user verifies their email rather than requiring users to login again mid registration. For this we do a 'silent' call to auth0 with |
Definitely. We will be working on a fix with the above mentioned feedbacks. You can expect a release by end of next week. |
@rick-lannan-upgrowth we have a PR that will propagate more error codes in Android. Do have a look at it and let us know. We will close this issue and continue the conversation in the PR. |
Hi, I notice there is a PR for Android. Is there a PR coming that also fixes this for iOS? |
Checklist
Description
In the v2 versions of the module, errors returned from IOS and Android were consistent with the following format that could be normalised to get a cross platform error code and description from the
name
andmessage
props (or thejson.error
andjson.error_description
props):In the v3 implementation the errors are not the same for IOS and Android and there seems to be no way to get an API error code. Both IOS and Android returns errors with roughly the same structure but the
code
prop does not include the API error codes and the mappings used are not the same cross platform:Specific problem are:
code
is not the same across device. For example, the cancel error is nowUSER_CANCELLED
in IOS but it is stilla0.session.user_cancelled
in Android. It looks like the codes have been remapped in the new IOS implementation without realising this is a breaking change for any application that is listening for errorsa0.response.invalid
(Android) orOTHER
(IOS) rather than passing through the error code returned from the API. This could be ok if another prop was provided for the api error code (or better yet the raw API error) but we seem to only have themessage
prop, which inconsistently either has the api error code or an error message, but not both. And the exact wording of themessage
is not consistent across IOS and Android so determining the actual error in code cross platform is problematicauthorize
,getCredentials
,clearSession
, etc). This was also the case with v2 but at least the errors were somewhat consistentReproduction
Simplest way is to call
authorize
and cancel the overlay, you can see the error returned for the cancel event is inconsistent cross platform. The same issue applies to any error generated thoughAdditional context
No response
react-native-auth0 version
3.0.0, 3.0.1
React Native version
Any
Expo version
No response
Platform
Android and IOS
Platform version(s)
Any
The text was updated successfully, but these errors were encountered: