-
Notifications
You must be signed in to change notification settings - Fork 48
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
Trigger error callback for Network Failures #113
Comments
I'm also trying to catch network failures on |
@rkorebrits Did you find any solution to network error? I'm getting a 504 error in the console and the error callback is not getting triggered. @benhutchins |
well here we are.. i'm having the 504 error on recaptcha load.. but only in production.. I'm running a pwa with Ionic hosted in firebase.. it works great locally though. any suggestion on how to fix it?
|
Currently, calling
ReCaptchaV3Service.execute
won't trigger theerrorCallback
when there is a network failure.From a brief test, this is because the
script
tag that is added can fail to load and that is never handled or listened for.Looking at this code:
This initially allows this to work:
Essentially this needs to be added:
And then the things that rely on this method needs to be updated to expect an error and pass that error along as necessary.
Overall, mobile users can lose network frequently, and this script failing to load can happen in situations. Right now, there is no way to get this error handled through ngx-recaptcha. So in these situations where you need recaptcha and are waiting for the callback, nothing will ever occur.
I've worked around this dumbly by adding a separate timeout that just assumes it failed after a given amount of time, but it'd be nice if the library triggered the
errorCallback
.The text was updated successfully, but these errors were encountered: