auth: redirect landing URL with subpath prepended (#5964)

pull/5965/head
ᴜɴᴋɴᴡᴏɴ 2020-03-04 02:02:12 +08:00 committed by GitHub
parent 931da04dc2
commit 8df3350252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -52,7 +52,8 @@ APP_DATA_PATH = data
; Whether to enable to load assets (i.e. "conf", "templates", "public") from disk instead of embedded bindata.
LOAD_ASSETS_FROM_DISK = false
; The landing page URL for anonymous users, can be a link to a external site.
; The landing page URL for anonymous users, the value should not include
; subpath that is handled by the reverse proxy.
LANDING_URL = /
; Whether to disable SSH access to the application entirely.

File diff suppressed because one or more lines are too long

View File

@ -41,7 +41,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
// Check non-logged users landing page.
if !c.IsLogged && c.Req.RequestURI == "/" && conf.Server.LandingURL != "/" {
c.Redirect(conf.Server.LandingURL)
c.SubURLRedirect(conf.Server.LandingURL)
return
}