File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -76,9 +76,22 @@ func handlePushEvent(gh utils.GithubClientProvider, payload *github.PushEvent) e
7676}
7777
7878func (mc MainController ) GithubAppCallbackPage (c * gin.Context ) {
79- installationId := c .Request .URL .Query ()["installation_id" ][0 ]
80- //setupAction := c.Request.URL.Query()["setup_action"][0]
81- code := c .Request .URL .Query ()["code" ][0 ]
79+ installationIds := c .Request .URL .Query ()["installation_id" ]
80+ if len (installationIds ) == 0 {
81+ log .Printf ("installationId parameter missing in callback" )
82+ c .String (http .StatusBadRequest , "installation ID parameter is missing" )
83+ return
84+ }
85+ installationId := installationIds [0 ]
86+
87+ codes := c .Request .URL .Query ()["code" ]
88+ if len (codes ) == 0 {
89+ log .Printf ("code parameter missing in callback" )
90+ c .String (http .StatusBadRequest , "code parameter missing in callback" )
91+ return
92+ }
93+ code := codes [0 ]
94+
8295 clientId := os .Getenv ("GITHUB_APP_CLIENT_ID" )
8396 clientSecret := os .Getenv ("GITHUB_APP_CLIENT_SECRET" )
8497
You can’t perform that action at this time.
0 commit comments