diff options
Diffstat (limited to 'pkg/context/context.go')
-rw-r--r-- | pkg/context/context.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/context/context.go b/pkg/context/context.go index f106cd40..a225ce67 100644 --- a/pkg/context/context.go +++ b/pkg/context/context.go @@ -40,6 +40,7 @@ type Context struct { User *models.User IsLogged bool IsBasicAuth bool + IsTokenAuth bool Repo *Repository Org *Organization @@ -289,8 +290,8 @@ func Contexter() macaron.Handler { c.Header().Set("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With") } - // Get user from session if logined. - c.User, c.IsBasicAuth = auth.SignedInUser(c.Context, c.Session) + // Get user from session or header when possible + c.User, c.IsBasicAuth, c.IsTokenAuth = auth.SignedInUser(c.Context, c.Session) if c.User != nil { c.IsLogged = true |