From ed4618c4d017ffc64fd33fcd1fa453d2763c4a42 Mon Sep 17 00:00:00 2001 From: Joshua Laymon Date: Sat, 10 Jan 2026 00:27:49 +0000 Subject: [PATCH] Update web/core/views.py --- web/core/views.py | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/web/core/views.py b/web/core/views.py index f75dc77..c4a29ef 100644 --- a/web/core/views.py +++ b/web/core/views.py @@ -54,28 +54,7 @@ EXPECTED_HEADERS = [ ] def login_view(request): - # If Django session already exists, go straight in - if request.user.is_authenticated: - return redirect("search") - - # Auto-start OIDC ONLY on a clean GET to /login/ - # If ?next= is present, Django is already in a redirect flow — don't loop - if request.method == "GET" and "next" not in request.GET: - return redirect("oidc_authentication_init") - - # Fallback (rare): render the page so the user can click manually - ctx = {} - - if request.method == "POST": - u = request.POST.get("username") - p = request.POST.get("password") - user = authenticate(request, username=u, password=p) - if user: - login(request, user) - return redirect("search") - ctx["error"] = "Invalid credentials" - - return render(request, "login.html", ctx) + return redirect("oidc_authentication_init")