feat: fix access_token endpoint cannot read clientId in form when using device code flow (#3800)

This commit is contained in:
DacongDA 2025-05-17 18:53:38 +08:00 committed by GitHub
parent 4260efcfd0
commit 521f90a603
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -177,10 +177,6 @@ func (c *ApiController) GetOAuthToken() {
clientId, clientSecret, _ = c.Ctx.Request.BasicAuth() clientId, clientSecret, _ = c.Ctx.Request.BasicAuth()
} }
if grantType == "urn:ietf:params:oauth:grant-type:device_code" {
clientId, clientSecret, _ = c.Ctx.Request.BasicAuth()
}
if len(c.Ctx.Input.RequestBody) != 0 && grantType != "urn:ietf:params:oauth:grant-type:device_code" { if len(c.Ctx.Input.RequestBody) != 0 && grantType != "urn:ietf:params:oauth:grant-type:device_code" {
// If clientId is empty, try to read data from RequestBody // If clientId is empty, try to read data from RequestBody
var tokenRequest TokenRequest var tokenRequest TokenRequest