summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-19 00:22:16 -0500
committerUnknwon <u@gogs.io>2015-11-19 00:22:16 -0500
commitee686f62315006df6d85ad0f74dfc6119b920469 (patch)
treec249246bb14215e71838242ca1cba5667b9ea744
parent481be9b5c91484426a8a58d7cfe4b31de8ef3a99 (diff)
downloadgitea-ee686f62315006df6d85ad0f74dfc6119b920469.tar.gz
gitea-ee686f62315006df6d85ad0f74dfc6119b920469.zip
minor fix on auto sign in
-rw-r--r--modules/middleware/auth.go4
1 files 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
}
}