File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ func AuthorizeHandler() gin.HandlerFunc {
4242 scopeString := strings .TrimSpace (gc .Query ("scope" ))
4343 clientID := strings .TrimSpace (gc .Query ("client_id" ))
4444 responseMode := strings .TrimSpace (gc .Query ("response_mode" ))
45+ nonce := strings .TrimSpace (gc .Query ("nonce" ))
4546
4647 var scope []string
4748 if scopeString == "" {
@@ -78,11 +79,13 @@ func AuthorizeHandler() gin.HandlerFunc {
7879 })
7980
8081 code := uuid .New ().String ()
81- nonce := uuid .New ().String ()
82+ if nonce == "" {
83+ nonce = uuid .New ().String ()
84+ }
8285 memorystore .Provider .SetState (codeChallenge , code )
8386
8487 // used for response mode query or fragment
85- loginState := "state=" + state + "&scope=" + strings .Join (scope , " " ) + "&redirect_uri=" + redirectURI + "&code=" + code + "&nonce=" + nonce
88+ loginState := "state=" + state + "&scope=" + strings .Join (scope , " " ) + "&redirect_uri=" + redirectURI + "&code=" + code
8689 loginURL := "/app?" + loginState
8790
8891 if responseMode == constants .ResponseModeFragment {
You can’t perform that action at this time.
0 commit comments