mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
must return json response from /api/login/ping
Even though http error 401 was returned, the result was still a http 200
This commit is contained in:
parent
11c4967bdc
commit
dd5a8275f1
@ -78,12 +78,13 @@ func tryOAuthAutoLogin(c *m.ReqContext) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) LoginAPIPing(c *m.ReqContext) Response {
|
||||
if c.IsSignedIn || c.IsAnonymous {
|
||||
return JSON(200, "Logged in")
|
||||
func (hs *HTTPServer) LoginAPIPing(c *m.ReqContext) {
|
||||
if c.IsSignedIn || (c.AllowAnonymous && c.IsAnonymous) {
|
||||
c.JsonOK("Logged in")
|
||||
return
|
||||
}
|
||||
|
||||
return Error(401, "Unauthorized", nil)
|
||||
c.JsonApiErr(401, "Unauthorized", nil)
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) LoginPost(c *m.ReqContext, cmd dtos.LoginCommand) Response {
|
||||
|
Loading…
Reference in New Issue
Block a user