mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dead code
This commit is contained in:
parent
0495499b4f
commit
f3125b447b
@ -138,28 +138,28 @@ func initContextWithToken(ctx *m.ReqContext, orgID int64, ts *auth.UserAuthToken
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func initContextWithUserSessionCookie(ctx *m.ReqContext, orgId int64) bool {
|
// func initContextWithUserSessionCookie(ctx *m.ReqContext, orgId int64) bool {
|
||||||
// initialize session
|
// // initialize session
|
||||||
if err := ctx.Session.Start(ctx.Context); err != nil {
|
// if err := ctx.Session.Start(ctx.Context); err != nil {
|
||||||
ctx.Logger.Error("Failed to start session", "error", err)
|
// ctx.Logger.Error("Failed to start session", "error", err)
|
||||||
return false
|
// return false
|
||||||
}
|
// }
|
||||||
|
|
||||||
var userId int64
|
// var userId int64
|
||||||
if userId = getRequestUserId(ctx); userId == 0 {
|
// if userId = getRequestUserId(ctx); userId == 0 {
|
||||||
return false
|
// return false
|
||||||
}
|
// }
|
||||||
|
|
||||||
query := m.GetSignedInUserQuery{UserId: userId, OrgId: orgId}
|
// query := m.GetSignedInUserQuery{UserId: userId, OrgId: orgId}
|
||||||
if err := bus.Dispatch(&query); err != nil {
|
// if err := bus.Dispatch(&query); err != nil {
|
||||||
ctx.Logger.Error("Failed to get user with id", "userId", userId, "error", err)
|
// ctx.Logger.Error("Failed to get user with id", "userId", userId, "error", err)
|
||||||
return false
|
// return false
|
||||||
}
|
// }
|
||||||
|
|
||||||
ctx.SignedInUser = query.Result
|
// ctx.SignedInUser = query.Result
|
||||||
ctx.IsSignedIn = true
|
// ctx.IsSignedIn = true
|
||||||
return true
|
// return true
|
||||||
}
|
// }
|
||||||
|
|
||||||
func initContextWithApiKey(ctx *m.ReqContext) bool {
|
func initContextWithApiKey(ctx *m.ReqContext) bool {
|
||||||
var keyString string
|
var keyString string
|
||||||
|
Loading…
Reference in New Issue
Block a user