Update web/core/views.py
This commit is contained in:
parent
1ada8e4fa2
commit
543ff3c5cc
@ -60,16 +60,8 @@ def is_admin(user):
|
||||
|
||||
|
||||
def login_view(request):
|
||||
# Already logged into Django
|
||||
if request.user.is_authenticated:
|
||||
return redirect("search")
|
||||
|
||||
# Pangolin + Authentik already authenticated the user at the proxy layer
|
||||
# → immediately initiate OIDC login
|
||||
if request.method == "GET":
|
||||
return redirect("oidc_authentication_init")
|
||||
|
||||
# Fallback: local username/password login (optional)
|
||||
ctx = {}
|
||||
if request.method == "POST":
|
||||
u = request.POST.get("username")
|
||||
@ -79,7 +71,6 @@ def login_view(request):
|
||||
login(request, user)
|
||||
return redirect("search")
|
||||
ctx["error"] = "Invalid credentials"
|
||||
|
||||
return render(request, "login.html", ctx)
|
||||
|
||||
def entry_context(entry, result_ids):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user