aboutsummaryrefslogtreecommitdiff
path: root/modules/middleware
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-11-24 18:47:59 -0500
committerUnknwon <joe2010xtmf@163.com>2014-11-24 18:47:59 -0500
commit54d25c13d7a5f52d44680626c45d84d0193091a0 (patch)
tree3593e299188000c2a0bcea1932512095f8a429a7 /modules/middleware
parent23d53561d110620ef7e656d2fedfe17708876957 (diff)
Fix #543
Diffstat (limited to 'modules/middleware')
-rw-r--r--modules/middleware/auth.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go
index fc8e94bb..94bb1c14 100644
--- a/modules/middleware/auth.go
+++ b/modules/middleware/auth.go
@@ -29,6 +29,12 @@ func Toggle(options *ToggleOptions) macaron.Handler {
return
}
+ // Checking non-logged users landing page.
+ if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageUrl != setting.LANDING_PAGE_HOME {
+ ctx.Redirect(string(setting.LandingPageUrl))
+ return
+ }
+
// Redirect to dashboard if user tries to visit any non-login page.
if options.SignOutRequire && ctx.IsSigned && ctx.Req.RequestURI != "/" {
ctx.Redirect(setting.AppSubUrl + "/")