Skip to content

Commit

Permalink
quickLogin: allow permanent login via url param
Browse files Browse the repository at this point in the history
  • Loading branch information
dezhidki committed Mar 5, 2025
1 parent 76e0c4a commit e115d59
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions timApp/auth/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,9 @@ def save_came_from() -> None:


@login_page.get("/quickLogin/<username>")
def quick_login(username: str, redirect: bool = True) -> Response:
def quick_login(
username: str, redirect: bool = True, restore_on_logout: bool = True
) -> Response:
"""Logs in as another user."""
user = User.get_by_name(username)
curr_user = get_restored_context_user()
Expand Down Expand Up @@ -608,7 +610,7 @@ def quick_login(username: str, redirect: bool = True) -> Response:
else:
verify_admin(user=curr_user)

set_single_user_to_session(user, restore_on_logout=True)
set_single_user_to_session(user, restore_on_logout=restore_on_logout)
db.session.commit()
flash(f"Temporarily logged in as: {username}")

Expand Down

0 comments on commit e115d59

Please sign in to comment.