Description
Checklist
- The issue can be reproduced in the auth0-js sample app (or N/A).
- I have looked into the Readme and Examples, and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Description
Reading Auth-0's documentation on "Add Bot Detection to Custom Login Pages," they mention that we can use the renderPasswordlessCaptcha function to append a captcha challenge to a document element. Reading your documentation, I can see that there is a mention on https://auth0.github.io/auth0.js/WebAuth.html#renderPasswordlessCaptcha about using that same function to render a captcha challenge. Whenever I try to append the captcha element to a div element using renderPasswordlessCaptcha, I get the following error shown in the console:
chunk-KIZHJP3H.js?v=c559862b:16417 Uncaught TypeError: Cannot read properties of undefined (reading 'required')
at challengeCallback (auth0-js.js?v=9947444d:4169:94)
at PasswordlessAuthentication.getChallenge (auth0-js.js?v=9947444d:4416:12)
at load (auth0-js.js?v=9947444d:4236:80)
at Object.render (auth0-js.js?v=9947444d:4238:72)
at WebAuth.renderPasswordlessCaptcha (auth0-js.js?v=9947444d:4386:18)
at component.tsx:240:21
at sentryWrapped (chunk-JP3H.js?v=c519862b:16400:17)
I initialize the WebAuth instance using:
export const webAuth0Instance = new auth0.WebAuth(auth0Config); and as such, I am able to run a variety of functions including, but not limited to:
- parseHash
- client.userInfo
- authorize
- passwordlessStart
- ... and so on
Furthermore, on the official readme page: https://github.com/auth0/auth0.js#readme there is no mention of any captcha functions other than
[renderCaptcha(element, options, callback)](https://auth0.github.io/auth0.js/WebAuth.html#renderCaptcha)
so I am wondering if your official docs page: https://auth0.github.io/auth0.js/WebAuth.html is out of date or what?
Furthermore #2: the @types package for this module also doesn't list any captcha functions other than renderCaptcha: https://www.npmjs.com/package/@types/auth0-js
Can someone tell me how I can achieve a passwordless captcha flow using your package, and if it's even possible?
Reproduction
- setup web auth client with proper credentials
- create an element in dom with custom classname - just a simple div with nothing inside of it, per auth-0 docs step 2: https://auth0.com/docs/secure/attack-protection/bot-detection/bot-detection-custom-login-pages#support-passwordless-flows
- try to append passwordless captcha using web auth client you initialized in step1 and call any of the captcha functions (none should work): renderCaptcha, renderPasswordlessCaptcha and renderPasswordResetCaptcha
- you should see an error in the console
Additional context
No response
auth0-js version
9.26.1
Which browsers have you tested in?
Chrome