fix state management
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
type State struct {
|
||||
AuthorizerURL string `json:"authorizerURL"`
|
||||
RedirectURL string `json:"redirectURL"`
|
||||
State string `json:"state"`
|
||||
}
|
||||
|
||||
// AppHandler is the handler for the /app route
|
||||
@@ -80,6 +81,7 @@ func AppHandler() gin.HandlerFunc {
|
||||
"data": map[string]string{
|
||||
"authorizerURL": stateObj.AuthorizerURL,
|
||||
"redirectURL": stateObj.RedirectURL,
|
||||
"state": stateObj.State,
|
||||
"organizationName": envstore.EnvStoreObj.GetStringStoreEnvVariable(constants.EnvKeyOrganizationName),
|
||||
"organizationLogo": envstore.EnvStoreObj.GetStringStoreEnvVariable(constants.EnvKeyOrganizationLogo),
|
||||
},
|
||||
|
@@ -51,7 +51,7 @@ func AuthorizeHandler() gin.HandlerFunc {
|
||||
isQuery := responseMode == "query"
|
||||
|
||||
hostname := utils.GetHost(gc)
|
||||
loginRedirectState := crypto.EncryptB64(`{"authorizerURL":"` + hostname + `","redirectURL":"` + redirectURI + `"}`)
|
||||
loginRedirectState := crypto.EncryptB64(`{"authorizerURL":"` + hostname + `","redirectURL":"` + redirectURI + `", "state":"` + state + `"}`)
|
||||
loginURL := "/app?state=" + loginRedirectState
|
||||
|
||||
if clientID == "" {
|
||||
|
Reference in New Issue
Block a user