fix(auth proxy): Fix for server side rendering of panel when using auth proxy, fixes #2568

This commit is contained in:
Torkel Ödegaard
2015-08-21 07:49:49 +02:00
parent abd7c15ba8
commit 7072af7c14
3 changed files with 11 additions and 1 deletions
+9
View File
@@ -2,6 +2,7 @@ package middleware
import (
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/log"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"
)
@@ -39,8 +40,16 @@ func initContextWithAuthProxy(ctx *Context) bool {
}
}
// initialize session
if err := ctx.Session.Start(ctx); err != nil {
log.Error(3, "Failed to start session", err)
return false
}
ctx.SignedInUser = query.Result
ctx.IsSignedIn = true
ctx.Session.Set(SESS_KEY_USERID, ctx.UserId)
return true
}