core: fix messages not being shown when no client is connected
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
20
authentik/core/templates/base/header_js.html
Normal file
20
authentik/core/templates/base/header_js.html
Normal file
@ -0,0 +1,20 @@
|
||||
<script>
|
||||
window.authentik = {};
|
||||
window.authentik.locale = "{{ tenant.default_locale }}";
|
||||
window.authentik.config = JSON.parse('{{ config_json|escapejs }}');
|
||||
window.authentik.tenant = JSON.parse('{{ tenant_json|escapejs }}');
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
{% for message in messages %}
|
||||
window.dispatchEvent(
|
||||
new CustomEvent("ak-message", {
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
detail: {
|
||||
level: "{{ message.tags|escapejs }}",
|
||||
message: "{{ message.message|escapejs }}",
|
||||
},
|
||||
}),
|
||||
);
|
||||
{% endfor %}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user