From ee686f62315006df6d85ad0f74dfc6119b920469 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 19 Nov 2015 00:22:16 -0500 Subject: [PATCH] minor fix on auto sign in --- modules/middleware/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go index 2dd9b0fd98..4b9531571b 100644 --- a/modules/middleware/auth.go +++ b/modules/middleware/auth.go @@ -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 } }