mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
Improve login error handling.
This commit is contained in:
@ -116,7 +116,10 @@ func (c *ApiController) Login() {
|
||||
// https://github.com/golang/oauth2/issues/123#issuecomment-103715338
|
||||
token, err := idProvider.GetToken(form.Code)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
resp = &Response{Status: "error", Msg: err.Error()}
|
||||
c.Data["json"] = resp
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
if !token.Valid() {
|
||||
|
Reference in New Issue
Block a user