Update web/core/views.py
This commit is contained in:
parent
2b6a8820e0
commit
3041786644
@ -58,17 +58,13 @@ def login_view(request):
|
|||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
return redirect("search")
|
return redirect("search")
|
||||||
|
|
||||||
# IMPORTANT:
|
# Auto-initiate OIDC only for direct /login access
|
||||||
# Only auto-initiate OIDC on a *direct* visit to /login/
|
if request.method == "GET" and request.path == "/login/":
|
||||||
# Never during the OIDC callback flow
|
|
||||||
if (
|
|
||||||
request.method == "GET"
|
|
||||||
and not request.path.startswith("/oidc/")
|
|
||||||
):
|
|
||||||
return redirect("oidc_authentication_init")
|
return redirect("oidc_authentication_init")
|
||||||
|
|
||||||
# Local login fallback (optional)
|
|
||||||
ctx = {}
|
ctx = {}
|
||||||
|
|
||||||
|
# Optional local login fallback
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
u = request.POST.get("username")
|
u = request.POST.get("username")
|
||||||
p = request.POST.get("password")
|
p = request.POST.get("password")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user