Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github installation callback missing the "code" parameter #1879

Open
motatoes opened this issue Jan 31, 2025 · 0 comments
Open

github installation callback missing the "code" parameter #1879

motatoes opened this issue Jan 31, 2025 · 0 comments

Comments

@motatoes
Copy link
Contributor

in some cases github when an app installation is being updated it decides to not send a code paramter which we expect to recieve here:

func (d DiggerController) GithubAppCallbackPage(c *gin.Context) {
installationId := c.Request.URL.Query()["installation_id"][0]
//setupAction := c.Request.URL.Query()["setup_action"][0]
code := c.Request.URL.Query()["code"][0]
appId := c.Request.URL.Query().Get("state")
clientId, clientSecret, _, _, err := d.GithubClientProvider.FetchCredentials(appId)
if err != nil {
log.Printf("could not fetch credentials for the app: %v", err)

this causes an exception on callback and we need to handle it properly. The callback from github sometimes look like this: /github/callback?installation_id=1234567890&setup_action=update

In this case we need to handle a missing code parameter and then lookup the installation_id from the db records then perform the update accordingly somehow TBD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant