mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
feat: return HTTP status 400 instead of 200 in GetOAuthToken() (#3807)
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user