From 315596c60392d7e9a4b021baa42d543a1f73f288 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Tue, 13 Apr 2021 09:57:49 +0200 Subject: [PATCH] Remap state param on def. client authorization --- auth/handlers/handle_oauth2.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/auth/handlers/handle_oauth2.go b/auth/handlers/handle_oauth2.go index 49c352c19..597172473 100644 --- a/auth/handlers/handle_oauth2.go +++ b/auth/handlers/handle_oauth2.go @@ -234,6 +234,10 @@ func (h AuthHandlers) oauth2authorizeDefaultClient(req *request.AuthReq) (err er params.Set("scope", scope[0]) } + if state, has := req.Request.Form["state"]; has && len(state) > 0 { + params.Set("state", state[0]) + } + req.RedirectTo = GetLinks().OAuth2Authorize + "?" + params.Encode() return }