feat: return HTTP status 400 instead of 200 in GetOAuthToken() (#3807)

This commit is contained in:
DacongDA 2025-05-20 01:05:43 +08:00 committed by GitHub
parent 086859d1ce
commit 1173f75794
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -229,6 +229,7 @@ func (c *ApiController) GetOAuthToken() {
ErrorDescription: "token is expired",
}
c.ServeJSON()
c.SetTokenErrorHttpStatus()
return
}
@ -239,6 +240,7 @@ func (c *ApiController) GetOAuthToken() {
ErrorDescription: "authorization pending",
}
c.ServeJSON()
c.SetTokenErrorHttpStatus()
return
}
@ -248,6 +250,7 @@ func (c *ApiController) GetOAuthToken() {
ErrorDescription: "token is expired",
}
c.ServeJSON()
c.SetTokenErrorHttpStatus()
return
}
object.DeviceAuthMap.Delete(deviceCode)