Skip to content

Instantly share code, notes, and snippets.

@saltukalakus
Last active November 7, 2024 19:10
Show Gist options
  • Save saltukalakus/637e3b1dc2b04c8fdbec10aaabcd9d7e to your computer and use it in GitHub Desktop.
Save saltukalakus/637e3b1dc2b04c8fdbec10aaabcd9d7e to your computer and use it in GitHub Desktop.
Logo handling
  • In the Organization context, the template uses the Organization's Logo
  • If not in the Organization context, the template uses the Application Logo
  • If the Application Logo is missing, the template uses the Tenant Logo
  • In the Application logo exists use the Application's Logo ,
  • Else use the Organization's Logo if the request is within the Organization
  • If the Organization logo and the Applicaiton logo doesn't exist use the Tenant Logo
<!DOCTYPE html><html>
<head>
{%- auth0:head -%}
<style>
{% unless organization %}
{% if application.logo_url and application.logo_url != "" %}
#custom-prompt-logo {
background-image: url({{application.logo_url}});
}
{% else %}
#custom-prompt-logo {
background-image: url({{branding.logo_url}});
}
{% endif %}
{% endunless %}
</style>
</head>
{% if organization %}
<body class="_widget-auto-layout" >
{%- auth0:widget -%}
</body>
{% else %}
<body class="_widget-auto-layout _use-custom-prompt-logo" >
{%- auth0:widget -%}
</body>
{% endif %}
<footer class="footer"><ul><li>Privacy Policy</li></ul></footer>
</html>
<!DOCTYPE html><html>
<head>
{%- auth0:head -%}
<style>
{% if application.logo_url and application.logo_url != "" %}
#custom-prompt-logo {
background-image: url({{application.logo_url}});
}
{% elsif organization %}
{% unless organization.branding.logo_url and organization.branding.logo_url != "" %}
#custom-prompt-logo {
background-image: url({{branding.logo_url}});
}
{% endunless %}
{% else %}
#custom-prompt-logo {
background-image: url({{branding.logo_url}});
}
{% endif %}
</style>
</head>
{% if application.logo_url and application.logo_url != "" %}
<body class="_widget-auto-layout _use-custom-prompt-logo" >
{%- auth0:widget -%}
</body>
{% elsif organization %}
{% if organization.branding.logo_url and organization.branding.logo_url != "" %}
<body class="_widget-auto-layout" >
{%- auth0:widget -%}
</body>
{% else %}
<body class="_widget-auto-layout _use-custom-prompt-logo" >
{%- auth0:widget -%}
</body>
{% endif %}
{% else %}
<body class="_widget-auto-layout _use-custom-prompt-logo" >
{%- auth0:widget -%}
</body>
{% endif %}
<footer class="footer"><ul><li>Privacy Policy</li></ul></footer>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment