now /api/login/ping returns Response

This commit is contained in:
Marcus Efraimsson
2019-02-04 17:37:07 +01:00
parent bd83078025
commit cfd8eb5167
2 changed files with 6 additions and 7 deletions

View File

@@ -78,13 +78,12 @@ func tryOAuthAutoLogin(c *m.ReqContext) bool {
return false
}
func (hs *HTTPServer) LoginAPIPing(c *m.ReqContext) {
if c.IsSignedIn || (c.AllowAnonymous && c.IsAnonymous) {
c.JsonOK("Logged in")
return
func (hs *HTTPServer) LoginAPIPing(c *m.ReqContext) Response {
if c.IsSignedIn || c.IsAnonymous {
return JSON(200, "Logged in")
}
c.JsonApiErr(401, "Unauthorized", nil)
return Error(401, "Unauthorized", nil)
}
func (hs *HTTPServer) LoginPost(c *m.ReqContext, cmd dtos.LoginCommand) Response {