-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support keycloak login to wagtail admin (#20)
- Loading branch information
1 parent
34b9a38
commit 67f3d0d
Showing
15 changed files
with
90 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/media/ | ||
/static/ | ||
*.sqlite3 | ||
.env | ||
|
||
# Python and others | ||
__pycache__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,3 @@ __pycache__ | |
# Dev assets and state | ||
db.sqlite3 | ||
media | ||
static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
version: '3' | ||
|
||
services: | ||
db: | ||
image: postgres:16-alpine | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
Django>=4.2,<4.3 | ||
wagtail>=6.2 | ||
psycopg>=3.1.8,<4.0 | ||
social-auth-app-django==5.4.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.conf import settings | ||
|
||
|
||
def get_site_info(request): | ||
return { | ||
"SITE_NAME": settings.SITE_NAME, | ||
"KEYCLOAK_LOGIN": settings.SOCIAL_AUTH_KEYCLOAK_KEY is not None, | ||
"DISABLE_LOCAL_AUTH": settings.DISABLE_LOCAL_AUTH, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% extends "wagtailadmin/base.html" %} | ||
|
||
{% block branding_title %}{{ SITE_NAME }}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% extends "wagtailadmin/home.html" %} | ||
|
||
{% block branding_welcome %}{{ SITE_NAME }}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% extends "wagtailadmin/login.html" %} | ||
{% load static %} | ||
|
||
{% block branding_login %}{{ SITE_NAME }}{% endblock %} | ||
|
||
{% block branding_logo %} | ||
<div class="login-logo"> | ||
<img src="{% static 'images/tglogo_noytral.png' %}" alt="The Gathering Logo" class="icon-wagtail" /> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block login_form %} | ||
{% if DISABLE_LOCAL_AUTH is False %} | ||
{{ block.super }} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block submit_buttons %} | ||
{% if DISABLE_LOCAL_AUTH is False %} | ||
{{ block.super }} | ||
{% endif %} | ||
{% if KEYCLOAK_LOGIN is True %} | ||
{% if DISABLE_LOCAL_AUTH is False %} | ||
<br/> | ||
<br/> | ||
{% endif %} | ||
<a href="{% url "social:begin" "keycloak" %}"><button type="button" class="button">Login using Wannabe5</button></a> | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters