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?
This seems like customization is very limited here if we can’t change the text dynamically. The documentation specified is very misleading in that case. Auth0 docs clearly specify that we can customize the Universal page based on type=invite. We should be able to customize the page on conditional logic especially when we could have done with Classic Login Pages. We can’t use that as our company has use cases for organizations so we have to stick with Universal Login. Organizations are bound to need customizations based on conditions.