From 8b89a428e0c198a68ede68ac7b9ccb81423c547c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Thu, 30 Jun 2022 15:41:50 +0200 Subject: [PATCH] Fix: clear next in the session before triggering a login (#1129) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: clear next in the session before triggering a login * Format Co-authored-by: Adrià Casajús --- app/auth/views/proton.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/auth/views/proton.py b/app/auth/views/proton.py index 6d82384f0..3d1571798 100644 --- a/app/auth/views/proton.py +++ b/app/auth/views/proton.py @@ -58,6 +58,8 @@ def proton_login(): next_url = sanitize_next_url(request.args.get("next")) if next_url: session["oauth_next"] = next_url + elif "oauth_next" in session: + del session["oauth_next"] proton = OAuth2Session(PROTON_CLIENT_ID, redirect_uri=_redirect_uri) authorization_url, state = proton.authorization_url(_authorization_base_url)