diff options
Diffstat (limited to 'modules/middleware/context.go')
-rw-r--r-- | modules/middleware/context.go | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go index 7d767b9e76..58b4f7497b 100644 --- a/modules/middleware/context.go +++ b/modules/middleware/context.go @@ -174,26 +174,6 @@ func Contexter() macaron.Handler { // Get user from session if logined. ctx.User = auth.SignedInUser(ctx.Req.Header, ctx.Session) - // Check with basic auth again. - if ctx.User == nil { - baHead := ctx.Req.Header.Get("Authorization") - auths := strings.Fields(baHead) - if len(auths) == 2 && auths[0] == "Basic" { - uname, passwd, _ := base.BasicAuthDecode(auths[1]) - u, err := models.GetUserByName(uname) - if err != nil { - if err != models.ErrUserNotExist { - ctx.Handle(500, "GetUserByName", err) - return - } - } else { - if u.ValidtePassword(passwd) { - ctx.User = u - } - } - } - } - if ctx.User != nil { ctx.IsSigned = true ctx.Data["IsSigned"] = ctx.IsSigned |