Skip to content

Commit

Permalink
fix: improve login redirect logic to handle next URL more robustly
Browse files Browse the repository at this point in the history
  • Loading branch information
TheophileDiot committed Feb 14, 2025
1 parent 899628b commit a245772
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/app/routes/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def login_page():
)

# redirect him to the page he originally wanted or to the home page
next_url = request.args.getlist("next")[-1] if request.args.getlist("next") else url_for("home.home_page")
next_url = request.args.get("next", "").split("?next=")[-1] or url_for("home.home_page")
return redirect(url_for("loading", next=next_url))
else:
flask_flash("Invalid username or password", "error")
Expand Down

0 comments on commit a245772

Please sign in to comment.