Skip to content
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

UnauthorizedError doesn't provide error message for android. #749

Closed
6 tasks done
lazzystep opened this issue Oct 3, 2023 · 6 comments
Closed
6 tasks done

UnauthorizedError doesn't provide error message for android. #749

lazzystep opened this issue Oct 3, 2023 · 6 comments
Labels
bug This points to a verified bug in the code

Comments

@lazzystep
Copy link

Checklist

Description

I'm using WebAuth to signup using email and password to get verification link and then be able to access the app. I get different error messages on iOS and Android.
At web dashboard I see error message: Please verify your email before trying to log in. error which is correct, but on android I receive An error occurred when trying to authenticate with the server error. On iOS it seems correct An unexpected error occurred. CAUSE: Please verify your email before trying to log in.

After a bit of debugging I found that error contains correct description, but not correct detailMessage. isVerificationRequired is also set to false.

So right now error gets to line: promise.reject("a0.response.invalid", error.getMessage(), error); and gets reject without necessary details. Can you add extra handler for it or provide some advices how to handle it so I can open a pr for it?

Screenshot 2023-10-03 at 16 43 12

Reproduction

sign up using email and password

Additional context

No response

react-native-auth0 version

3.0.1

React Native version

0.66.1

Expo version

No response

Platform

Android

Platform version(s)

all

@lazzystep lazzystep added the bug This points to a verified bug in the code label Oct 3, 2023
@lazzystep
Copy link
Author

Error configured as a rule in auth0 dashboard

...
  if (!user.email_verified) {
    return callback(
      new UnauthorizedError('Please verify your email before trying to log in.')
    );

@lazzystep lazzystep changed the title Wrong error message for android. UnauthorizedError doesn't provide error message for android. Oct 4, 2023
@poovamraj
Copy link
Contributor

@lazzystep This PR should address your issue - #720

We are planning to release this soon. You can verify it as well and let us know your feedback.

@lazzystep
Copy link
Author

@poovamraj thank you, I tried it but it didn't help me.
I'll try to test it out again later today and provide feedback.

@lazzystep
Copy link
Author

@poovamraj I double checked It and it seems that passing error doesn't allow developer to get value from description field which I think is important.
For example: in your manual testing results iOS contains it (Transaction failed, integrity_token not provided), but android is not. How developer can create condition if description field is missing?

Screenshot 2023-10-04 at 17 56 01

@poovamraj
Copy link
Contributor

poovamraj commented Oct 4, 2023

@lazzystep Can you check out this PR - #751

The missing error description is added now.

@lazzystep
Copy link
Author

@poovamraj awesome, thank you!

It solves my problem so I will close this issue. Will be waiting for this functionality in the future versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

2 participants