diff options
Diffstat (limited to 'modules/context/context.go')
-rw-r--r-- | modules/context/context.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/context/context.go b/modules/context/context.go index 2e43088ff8..c35a19480a 100644 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -17,6 +17,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/auth" + "code.gitea.io/gitea/modules/auth/sso" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" @@ -48,6 +49,11 @@ type Context struct { Org *Organization } +// GetData returns the data +func (ctx *Context) GetData() map[string]interface{} { + return ctx.Data +} + // IsUserSiteAdmin returns true if current user is a site admin func (ctx *Context) IsUserSiteAdmin() bool { return ctx.IsSigned && ctx.User.IsAdmin @@ -303,7 +309,7 @@ func Contexter() macaron.Handler { } // Get user from session if logged in. - ctx.User, ctx.IsBasicAuth = auth.SignedInUser(ctx.Context, ctx.Session) + ctx.User, ctx.IsBasicAuth = sso.SignedInUser(ctx.Req.Request, ctx, ctx.Session) if ctx.User != nil { ctx.IsSigned = true |