diff options
author | Unknwon <u@gogs.io> | 2017-04-06 17:27:57 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-04-06 17:27:57 -0400 |
commit | 90b9f7e08ca2e027cc587199537aa653ddd94d91 (patch) | |
tree | 0dbd625cd1eb929250befa07f18a0517ae23a5d1 /pkg/context/auth.go | |
parent | 2c404daca612b43bd6b0b720d3e732d9550c0eab (diff) |
pkg/setting: rename {AppUrl, AppSubUrl} -> {AppURL, AppSubURL}
Diffstat (limited to 'pkg/context/auth.go')
-rw-r--r-- | pkg/context/auth.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/context/auth.go b/pkg/context/auth.go index 642a320b..d2bfe603 100644 --- a/pkg/context/auth.go +++ b/pkg/context/auth.go @@ -25,7 +25,7 @@ func Toggle(options *ToggleOptions) macaron.Handler { return func(ctx *Context) { // Cannot view any page before installation. if !setting.InstallLock { - ctx.Redirect(setting.AppSubUrl + "/install") + ctx.Redirect(setting.AppSubURL + "/install") return } @@ -38,13 +38,13 @@ func Toggle(options *ToggleOptions) macaron.Handler { // Check non-logged users landing page. if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageURL != setting.LANDING_PAGE_HOME { - ctx.Redirect(setting.AppSubUrl + string(setting.LandingPageURL)) + 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 + "/") + ctx.Redirect(setting.AppSubURL + "/") return } @@ -65,8 +65,8 @@ func Toggle(options *ToggleOptions) macaron.Handler { return } - ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl) - ctx.Redirect(setting.AppSubUrl + "/user/login") + ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubURL+ctx.Req.RequestURI), 0, setting.AppSubURL) + ctx.Redirect(setting.AppSubURL + "/user/login") return } else if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm { ctx.Data["Title"] = ctx.Tr("auth.active_your_account") @@ -78,8 +78,8 @@ func Toggle(options *ToggleOptions) macaron.Handler { // Redirect to log in page if auto-signin info is provided and has not signed in. if !options.SignOutRequired && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) && len(ctx.GetCookie(setting.CookieUserName)) > 0 { - ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl) - ctx.Redirect(setting.AppSubUrl + "/user/login") + ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubURL+ctx.Req.RequestURI), 0, setting.AppSubURL) + ctx.Redirect(setting.AppSubURL + "/user/login") return } |