fix not respecting landing page setting

This commit is contained in:
David Schneiderbauer 2018-06-10 09:49:32 +02:00
parent 6efdcaed86
commit 1a2b8458d5
No known key found for this signature in database
GPG Key ID: 576113B2803B3EAB
2 changed files with 4 additions and 6 deletions

View File

@ -37,12 +37,6 @@ func Toggle(options *ToggleOptions) macaron.Handler {
return
}
// Check non-logged users landing page.
if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageURL != setting.LandingPageHome {
ctx.Redirect(setting.AppSubURL + string(setting.LandingPageURL))
return
}
// Redirect to dashboard if user tries to visit any non-login page.
if options.SignOutRequired && ctx.IsSigned && ctx.Req.RequestURI != "/" {
ctx.Redirect(setting.AppSubURL + "/")

View File

@ -42,6 +42,10 @@ func Home(ctx *context.Context) {
user.Dashboard(ctx)
}
return
// Check non-logged users landing page.
} else if setting.LandingPageURL != setting.LandingPageHome {
ctx.Redirect(setting.AppSubURL + string(setting.LandingPageURL))
return
}
// Check auto-login.