I’m following the guide to invite users to the application via password change ticket.
I’ve got custom domains set up, and now I’m trying to configure the reset-password prompt.
Using your Auth0 cli, I was able to load up the storybook editor tool to modify the reset-password template.
How can I conditionally render the text? I couldn’t figure it out and ended up doing this, which I don’t think is a good solution because I’m manually updating the text in the widget:
<!DOCTYPE html>
<html lang="{{locale}}">
<head>
{%- auth0:head -%}
<title>Welcome to {{ application.name }} </title>
</head>
<body class="_widget-auto-layout">
{%- auth0:widget -%}
</body>
<script>
function getQueryParameter(name) {
const url = window.location.href;
const params = new URLSearchParams(url.substring(url.indexOf('#') + 1));
return params.get(name);
}
const isInvite = getQueryParameter('type') === 'invite';
if (isInvite) {
document.title = 'Set Your Password';
const header = document.querySelector('h1');
if (header) {
header.textContent = 'Set Your Password';
}
const description = document.querySelector('p');
if (description) {
description.textContent = 'Please set your password to activate your account.';
}
}
</script>
</html>
Is there some way to have the auth0:widget use the values I have based on the param type?