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

Cannot seem to use renderPasswordlessCaptcha #1455

Open
6 tasks done
REX500 opened this issue Jul 30, 2024 · 0 comments
Open
6 tasks done

Cannot seem to use renderPasswordlessCaptcha #1455

REX500 opened this issue Jul 30, 2024 · 0 comments
Labels
bug This points to a verified bug in the code

Comments

@REX500
Copy link

REX500 commented Jul 30, 2024

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

  1. setup web auth client with proper credentials
  2. 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
  3. 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
  4. 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

@REX500 REX500 added the bug This points to a verified bug in the code label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

1 participant