Просмотр исходного кода

Merge pull request #919 from porter-dev/0.6.0-github-org-final-fixes

[0.6.0] Remove github oauth state check
jusrhee 4 лет назад
Родитель
Сommit
71df376d4b
1 измененных файлов с 0 добавлено и 16 удалено
  1. 0 16
      server/api/oauth_github_handler.go

+ 0 - 16
server/api/oauth_github_handler.go

@@ -298,22 +298,6 @@ func (app *App) HandleGithubAppOAuthCallback(w http.ResponseWriter, r *http.Requ
 		return
 	}
 
-	if _, ok := session.Values["state"]; !ok {
-		app.sendExternalError(
-			err,
-			http.StatusForbidden,
-			HTTPError{
-				Code: http.StatusForbidden,
-				Errors: []string{
-					"Could not read cookie: are cookies enabled?",
-				},
-			},
-			w,
-		)
-
-		return
-	}
-
 	token, err := app.GithubAppConf.Exchange(oauth2.NoContext, r.URL.Query().Get("code"))
 
 	if err != nil || !token.Valid() {