From 2d8194c7c2ac01dd51304b97cfacb1604bbd4081 Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Thu, 25 Nov 2021 00:27:09 +0100 Subject: [PATCH] Use FRONTEND_HTTPS for redirect url as well --- api/obs/api/routes/login.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/obs/api/routes/login.py b/api/obs/api/routes/login.py index ff5ec05..73994f7 100644 --- a/api/obs/api/routes/login.py +++ b/api/obs/api/routes/login.py @@ -38,12 +38,13 @@ async def login(req, next: str = None): session["state"] = rndstr() session["nonce"] = rndstr() session["next"] = next + scheme = 'https' if req.app.config.FRONTEND_HTTPS else req.scheme args = { "client_id": client.client_id, "response_type": "code", "scope": ["openid"], "nonce": session["nonce"], - "redirect_uri": req.scheme + "://" + req.host + "/login/redirect", + "redirect_uri": scheme + "://" + req.host + "/login/redirect", "state": session["state"], }