Browse Source

minor fix on auto sign in

tags/v0.9.99
Unknwon 8 years ago
parent
commit
ee686f6231
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      modules/middleware/auth.go

+ 2
- 2
modules/middleware/auth.go View File

@@ -110,13 +110,13 @@ func Toggle(options *ToggleOptions) macaron.Handler {
}

// Try auto-signin when not signed in.
if !ctx.IsSigned {
if !options.SignOutRequire && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) {
succeed, err := AutoSignIn(ctx)
if err != nil {
ctx.Handle(500, "AutoSignIn", err)
return
} else if succeed {
ctx.Redirect(ctx.Req.URL.Path)
ctx.Redirect(setting.AppSubUrl + ctx.Req.RequestURI)
return
}
}

Loading…
Cancel
Save