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

How to handle redirection errors #86

Open
Lilian-C opened this issue Dec 4, 2023 · 1 comment
Open

How to handle redirection errors #86

Lilian-C opened this issue Dec 4, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Lilian-C
Copy link

Lilian-C commented Dec 4, 2023

Hello,

I have a question regarding the package:

For example, in the case of a server-side error during authentication, we have an error page showing up to the user (error 5XX). I would like to be able to stop the authentication process and redirect the user back to the app instead. Is there any way to catch an error during a redirection to a page (like onWebResourceError does for web views) ?

Thanks :)

@Lilian-C Lilian-C added the enhancement New feature or request label Dec 4, 2023
@ThexXTURBOXx
Copy link
Owner

I think the easiest way to accomplish this is to just close the current tab (or rather simulate closing it).
This will immediately show the app again on iOS and Android. In the other implementations, it won't do anything but close the app.
At some point, a timeout might occurr, however.

Another possibility is to provide a callback to the app (just as if the registration was successful), but the URL query parameters contain some special string that can only occurr if the authentication was not successful - this should be done on the error page and might not be the best way to handle this, but the most fail-safe.

I don't think there is an easy way to accomplish error catching properly. But you can still try implementing it and submitting as a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants