Default PKCE method when missing

Co-authored-by: HFO4 <16058869+HFO4@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-03 06:54:13 +00:00
parent 0da65dcbf3
commit 541f0e119f

View File

@@ -60,6 +60,9 @@ func (s *GrantService) Get(c *gin.Context) (*GrantResponse, error) {
user := inventory.UserFromContext(c)
kv := dep.KV()
oAuthClient := dep.OAuthClientClient()
if s.CodeChallenge != "" && s.CodeChallengeMethod == "" {
s.CodeChallengeMethod = "S256"
}
// 1. Get app registration and grant
app, err := oAuthClient.GetByGUIDWithGrants(c, s.ClientID, user.ID)