Browse Source

dead code

Marcus Efraimsson 7 years ago
parent
commit
f3125b447b
1 changed files with 22 additions and 22 deletions
  1. 22 22
      pkg/middleware/middleware.go

+ 22 - 22
pkg/middleware/middleware.go

@@ -138,28 +138,28 @@ func initContextWithToken(ctx *m.ReqContext, orgID int64, ts *auth.UserAuthToken
 	return true
 }
 
-func initContextWithUserSessionCookie(ctx *m.ReqContext, orgId int64) bool {
-	// initialize session
-	if err := ctx.Session.Start(ctx.Context); err != nil {
-		ctx.Logger.Error("Failed to start session", "error", err)
-		return false
-	}
-
-	var userId int64
-	if userId = getRequestUserId(ctx); userId == 0 {
-		return false
-	}
-
-	query := m.GetSignedInUserQuery{UserId: userId, OrgId: orgId}
-	if err := bus.Dispatch(&query); err != nil {
-		ctx.Logger.Error("Failed to get user with id", "userId", userId, "error", err)
-		return false
-	}
-
-	ctx.SignedInUser = query.Result
-	ctx.IsSignedIn = true
-	return true
-}
+// func initContextWithUserSessionCookie(ctx *m.ReqContext, orgId int64) bool {
+// 	// initialize session
+// 	if err := ctx.Session.Start(ctx.Context); err != nil {
+// 		ctx.Logger.Error("Failed to start session", "error", err)
+// 		return false
+// 	}
+
+// 	var userId int64
+// 	if userId = getRequestUserId(ctx); userId == 0 {
+// 		return false
+// 	}
+
+// 	query := m.GetSignedInUserQuery{UserId: userId, OrgId: orgId}
+// 	if err := bus.Dispatch(&query); err != nil {
+// 		ctx.Logger.Error("Failed to get user with id", "userId", userId, "error", err)
+// 		return false
+// 	}
+
+// 	ctx.SignedInUser = query.Result
+// 	ctx.IsSignedIn = true
+// 	return true
+// }
 
 func initContextWithApiKey(ctx *m.ReqContext) bool {
 	var keyString string