Open sarasamuel opened 1 year ago
I have capture this error on my app in production by sentry but only on android devices, but I can't reproduce this on my environment, can you explain more about you issue, or paste here the error stack trace, it can help! I am working on get by sentry the error stack trace in future releases of my app.
Facing the same issue :(
Not sure anymore, but I think I see this consistently in our Sentry logs when a user cancels the login modal. You might try closing the authentication modal before completing the auth flow to see if that reproduces the error.
I think I found a fix for this. Essentially, I was calling the authorize() function asynchronously and attempting to set the auth state while awaiting authorize(). It seems as if structuring the code this way caused the auth component to re-render, at which point the error would arise. I resolved this by wrapping the authorization function in a useCallback() hook (similar to the structure in the example code), which prevents it from being run on each render.
Issue
I'm currently using react-native-app-auth 6.4.3 and react native 0.70.6, and I'm using the react-native-app-auth authorization function as follows:
Sometimes I am able to log in as expected, but other times it catches the error, "The operation couldn’t be completed. (org.openid.appauth.general error -3.)". The issue is very intermittent. Is there a suggested fix for this issue?
Environment
iOS
No