mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 10:20:29 -06:00
improves readability of loginping handler
This commit is contained in:
parent
516037fbdd
commit
9153b6ed96
@ -115,8 +115,8 @@ log_queries =
|
||||
# How many days an session can be unused before we inactivate it
|
||||
;login_remember_days = 7
|
||||
|
||||
# How often should the login token be rotated. default to '30m'
|
||||
;rotate_cookie_every = 30m
|
||||
# How often should the login token be rotated. default to '30'
|
||||
;rotate_token_minutes = 30
|
||||
|
||||
# How long should Grafana keep expired tokens before deleting them
|
||||
;delete_expired_token_after_days = 30
|
||||
|
@ -78,13 +78,12 @@ func tryOAuthAutoLogin(c *m.ReqContext) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) LoginAPIPing(c *m.ReqContext) {
|
||||
if !c.IsSignedIn || !c.IsAnonymous {
|
||||
c.JsonApiErr(401, "Unauthorized", nil)
|
||||
return
|
||||
func (hs *HTTPServer) LoginAPIPing(c *m.ReqContext) Response {
|
||||
if c.IsSignedIn || c.IsAnonymous {
|
||||
return JSON(200, "Logged in")
|
||||
}
|
||||
|
||||
c.JsonOK("Logged in")
|
||||
return Error(401, "Unauthorized", nil)
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) LoginPost(c *m.ReqContext, cmd dtos.LoginCommand) Response {
|
||||
|
Loading…
Reference in New Issue
Block a user