added logout functionality and updated login form validation
All checks were successful
Django Backend Validation / build (ubuntu-latest, 3.12) (push) Successful in 16s
Django Backend Validation / build (debian-latest, 3.11) (push) Successful in 20s
Django Backend Validation / build (debian-latest, 3.12) (push) Successful in 16s
Django Backend Validation / build (ubuntu-latest, 3.10) (push) Successful in 14s
Django Backend Validation / build (ubuntu-latest, 3.11) (push) Successful in 17s
Django Backend Validation / build (debian-latest, 3.10) (push) Successful in 17s

Signed-off-by: Jochen Mehlich <coding@jochenmehlich.de>
This commit is contained in:
Jochen Mehlich 2024-08-28 16:05:24 +02:00
parent fd249adbbb
commit a9d639db55
3 changed files with 9 additions and 3 deletions

View File

@ -3,4 +3,5 @@ from django.contrib.auth.models import User
class LoginForm(forms.Form):
username = forms.CharField(label="username", max_length=255)
password = forms.CharField(label="password", max_length=255, widget=forms.PasswordInput)
password = forms.CharField(label="password", max_length=255, widget=forms.PasswordInput)
auth_type = forms.CharField(label="auth_type", max_length=255)

View File

@ -22,5 +22,6 @@ urlpatterns = [
path('admin/', admin.site.urls),
path("__reload__/", include("django_browser_reload.urls")),
path("login", login, name="login"),
path("settings/", include('settings.urls'))
path("logout", logout, name="logout"),
path("settings/", include('settings.urls')),
]

View File

@ -22,4 +22,8 @@ def login(request):
else:
return render(request, "login.html", {"userError": True})
elif auth_type == "openid":
return render(request, "login.html")
return render(request, "login.html")
def logout(request):
dauth.logout(request)
return redirect("/")