Skip to content

Commit

Permalink
Add login form for admin that uses OIDC
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Feb 13, 2024
1 parent ec09ae6 commit e176b59
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
from . import models

admin.site.register(models.MafiasiUser, UserAdmin)
admin.site.login_template = 'core/login.html'
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% extends "admin/login.html" %}
{% load i18n %}
{% block content %}
<div id="content-main">

{% if user.is_authenticated %}
<p class="errornote">
{% blocktranslate trimmed %}
You are authenticated as {{ username }}, but are not authorized to
access this page. Would you like to login to a different account?
{% endblocktranslate %}
</p>
{% endif %}

<form id="login-form" method="get" action="{% url 'simple_openid_connect:login' %}">
<div class="submit-row">
<input type="submit" value="{% translate 'Log in with Mafiasi' %}">
</div>
</form>

</div>
{% endblock %}

0 comments on commit e176b59

Please sign in to comment.