Skip to content

Commit

Permalink
Reworked generating authorization links
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Rusakov committed Oct 10, 2024
1 parent 919ea15 commit 48b7860
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/templates/admin/login.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% extends "admin/login.html" %}
{% block body %}
{% block content %}
{{ block.super }}
{% if OIDC_ENABLED %}
<script>
window.onload = () => {
document.querySelector("input[value='Log in']")
.parentElement
.parentElement
.innerHTML += `<a href="/oidc/authenticate${window.location.search}">Login with Zitadel</a>`;
.innerHTML += `<a href="{% url 'oidc_authentication_init' %}?next={{ next }}">Login with Zitadel</a>`;
};
</script>
{% endif %}
Expand Down
8 changes: 7 additions & 1 deletion api/templates/rest_framework/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
document.querySelector("input[value='Log in']")
.parentElement
.parentElement
.innerHTML += `<a href="/oidc/authenticate${window.location.search}">Login with Zitadel</a>`;
.innerHTML += `
<div class="form-group"></div>
<div class="form-actions-no-box">
<a href="{% url 'oidc_authentication_init' %}?next={{ next }}">
<input type="button" class="btn btn-primary form-control" value="Login with Zitadel" />
</a>
</div>`;
};
</script>
{% endif %}
Expand Down

0 comments on commit 48b7860

Please sign in to comment.