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

Call done callback once Arkose is ready #1433

Merged
merged 2 commits into from May 14, 2024

Conversation

srijonsaha
Copy link
Contributor

@srijonsaha srijonsaha commented Apr 30, 2024

Changes

Call done callback inside Arkose's onReady callback to ensure Arkose is properly loaded. This'll help address the issue of Arkose taking a while to load and callers can rely on it to be sure when Arkose is fully loaded. Other captcha providers don't have a similar onReady callback so done call was moved to right after initialization.

https://developer.arkoselabs.com/docs/callbacks

References

https://auth0team.atlassian.net/browse/IAMRISK-3458

Testing

I tested this by setting a timeout to simulate the delay in Arkose loading. Here's a before and after comparison.

before.mov
after.mov
  • This change adds unit test coverage
  • This change adds integration test coverage

Checklist

Copy link

@josh-cain josh-cain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall seems to be headed in the right direction 👍 , just a few clarifying questions (I'm not the most familiar with this .js).

Also, could we please include at least one test that validates the passed done() function is called after Arkose is ready?

src/web-auth/captcha.js Show resolved Hide resolved
src/web-auth/captcha.js Show resolved Hide resolved
@srijonsaha srijonsaha requested a review from josh-cain May 9, 2024 19:14
Copy link
Contributor

@nandan-bhat nandan-bhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Accepting the PR.

@nandan-bhat nandan-bhat merged commit c004705 into auth0:master May 14, 2024
8 checks passed
@srijonsaha srijonsaha deleted the arkose-done-on-ready branch May 15, 2024 05:10
@nandan-bhat nandan-bhat mentioned this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants