mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +08:00
feat: return HTTP status 400 instead of 200 in GetOAuthToken() (#3807)
This commit is contained in:
parent
086859d1ce
commit
1173f75794
@ -229,6 +229,7 @@ func (c *ApiController) GetOAuthToken() {
|
|||||||
ErrorDescription: "token is expired",
|
ErrorDescription: "token is expired",
|
||||||
}
|
}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
|
c.SetTokenErrorHttpStatus()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,6 +240,7 @@ func (c *ApiController) GetOAuthToken() {
|
|||||||
ErrorDescription: "authorization pending",
|
ErrorDescription: "authorization pending",
|
||||||
}
|
}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
|
c.SetTokenErrorHttpStatus()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,6 +250,7 @@ func (c *ApiController) GetOAuthToken() {
|
|||||||
ErrorDescription: "token is expired",
|
ErrorDescription: "token is expired",
|
||||||
}
|
}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
|
c.SetTokenErrorHttpStatus()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
object.DeviceAuthMap.Delete(deviceCode)
|
object.DeviceAuthMap.Delete(deviceCode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user