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

fix(docs): document error() option for renderCaptcha() #1290

Merged
merged 2 commits into from Jan 26, 2023

Conversation

pmalouin
Copy link
Contributor

@pmalouin pmalouin commented Jan 25, 2023

Changes

The WebAuth.renderCaptcha(element, options, callback) and WebAuth.renderPasswordlessCaptcha(element, options, callback) methods accept an option to override the error message rendered when an error is returned while fetching the bot detection challenge. It can be used like this:

var webAuth = new auth0.WebAuth(params);
var options = {
  templates: {
    error: function(err) {
      return '<div class="error" style="color: red;">This is a custom error message...</div>';
    }
  }
};
var captcha = webAuth.renderCaptcha(
  document.querySelector('.captcha-container'),
  options
);

In this PR, I am adding jsdocs for these attributes, to document this option in our generated docs at https://auth0.github.io/auth0.js/WebAuth.html#renderCaptcha

References

Please include relevant links supporting this change such as a:

  • support ticket
  • community post
  • StackOverflow post
  • support forum thread

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change adds unit test coverage
  • This change adds integration test coverage

Checklist

@pmalouin pmalouin requested a review from a team as a code owner January 25, 2023 18:10
Copy link
Member

@frederikprijck frederikprijck left a comment

Choose a reason for hiding this comment

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

The WebAuth.renderCaptcha(element, options, callback) and WebAuth.renderPasswordlessCaptcha(element, options, callback) methods accept an option to override the error message rendered when an error is returned while fetching the bot detection challenge. It can be used like this:

This PR does not add docs to those methods, you want to add them here:

We can also keep what you have, but to reflect the docs for both WebAuth.renderCaptcha and WebAuth.renderPasswordlessCaptcha we need to ensure we patch the jsdoc for those methods.

@frederikprijck frederikprijck changed the title fix(docs): document error() option for renderCaptcha() fix(docs): document error() option for renderCaptcha() and renderPasswordlessCaptcha Jan 26, 2023
@frederikprijck frederikprijck changed the title fix(docs): document error() option for renderCaptcha() and renderPasswordlessCaptcha fix(docs): document error() option for renderCaptcha() and renderPasswordlessCaptcha Jan 26, 2023
@frederikprijck frederikprijck changed the title fix(docs): document error() option for renderCaptcha() and renderPasswordlessCaptcha fix(docs): document error() option for renderCaptcha() Jan 26, 2023
@frederikprijck frederikprijck merged commit 19c6253 into auth0:master Jan 26, 2023
@frederikprijck
Copy link
Member

Thanks 🎉

@stevehobbsdev stevehobbsdev mentioned this pull request Feb 28, 2023
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

2 participants