From df1cea7732b0f5a94a6395b3ceca5007e30cc805 Mon Sep 17 00:00:00 2001 From: Luca Date: Sat, 6 Jan 2024 16:53:40 +0100 Subject: [PATCH] feat: add oidc login/logout links to index page --- ljg/core/templates/index.html | 13 +++++++++++++ ljg/core/views.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ljg/core/templates/index.html diff --git a/ljg/core/templates/index.html b/ljg/core/templates/index.html new file mode 100644 index 0000000..e982056 --- /dev/null +++ b/ljg/core/templates/index.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% block body %} +{% if user.is_authenticated %} +{{ user.email }} +
+ {% csrf_token %} + +
+{% else %} +Login +{% endif %} +{% endblock %} diff --git a/ljg/core/views.py b/ljg/core/views.py index a99363f..1bfd9f4 100644 --- a/ljg/core/views.py +++ b/ljg/core/views.py @@ -2,4 +2,4 @@ from django.shortcuts import render def index(request): - return render(request, "base.html", {}) + return render(request, "index.html", {})