Use FRONTEND_HTTPS for redirect url as well

This commit is contained in:
Paul Bienkowski 2021-11-25 00:27:09 +01:00
parent 2b9bdb6ff1
commit 2d8194c7c2

View file

@ -38,12 +38,13 @@ async def login(req, next: str = None):
session["state"] = rndstr() session["state"] = rndstr()
session["nonce"] = rndstr() session["nonce"] = rndstr()
session["next"] = next session["next"] = next
scheme = 'https' if req.app.config.FRONTEND_HTTPS else req.scheme
args = { args = {
"client_id": client.client_id, "client_id": client.client_id,
"response_type": "code", "response_type": "code",
"scope": ["openid"], "scope": ["openid"],
"nonce": session["nonce"], "nonce": session["nonce"],
"redirect_uri": req.scheme + "://" + req.host + "/login/redirect", "redirect_uri": scheme + "://" + req.host + "/login/redirect",
"state": session["state"], "state": session["state"],
} }