logout inactive on exteranal auth

This commit is contained in:
Mateusz Gruszczyński
2026-05-25 10:07:51 +02:00
parent 9021b09bc5
commit ff7d836b77
6 changed files with 30 additions and 4 deletions

View File

@@ -195,6 +195,9 @@ def login():
@bp.get("/logout")
def logout():
# Note: External providers such as Tinyauth own the login session, so pyTorrent must not pretend to log the user out locally.
if auth.uses_external_provider():
return redirect(url_for("main.index"))
auth.logout_user()
if not auth.enabled():
return redirect(url_for("main.index"))
@@ -212,6 +215,8 @@ def index():
bootstrap_themes=BOOTSTRAP_THEMES,
font_families=FONT_FAMILIES,
auth_enabled=auth.enabled(),
auth_provider=auth.provider(),
external_auth=auth.uses_external_provider(),
current_user=auth.current_user(),
)