From c84174b7640c17c85c8e3bb86c02cd39b09822e1 Mon Sep 17 00:00:00 2001
From: zeripath
Date: Wed, 23 Oct 2019 22:04:22 +0100
Subject: [PATCH] Use AppSubUrl for more redirections (#8647)
Fix #8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template
Fixes /explore and organisation redirection
---
modules/context/org.go | 2 +-
options/locale/locale_en-US.ini | 2 +-
routers/home.go | 2 +-
templates/user/auth/grant.tmpl | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/context/org.go b/modules/context/org.go
index 486747433..10791c9d0 100644
--- a/modules/context/org.go
+++ b/modules/context/org.go
@@ -63,7 +63,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
// Force redirection when username is actually a user.
if !org.IsOrganization() {
- ctx.Redirect("/" + org.Name)
+ ctx.Redirect(setting.AppSubURL + "/" + org.Name)
return
}
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 60acab017..83047ef6f 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -259,7 +259,7 @@ openid_signin_desc = Enter your OpenID URI. For example: https://anne.me, bob.op
disable_forgot_password_mail = Account recovery is disabled. Please contact your site administrator.
email_domain_blacklisted = You cannot register with your email address.
authorize_application = Authorize Application
-authroize_redirect_notice = You will be redirected to %s if you authorize this application.
+authorize_redirect_notice = You will be redirected to %s if you authorize this application.
authorize_application_created_by = This application was created by %s.
authorize_application_description = If you grant the access, it will be able to access and write to all your account information, including private repos and organisations.
authorize_title = Authorize "%s" to access your account?
diff --git a/routers/home.go b/routers/home.go
index f8fb849c8..eddff28ee 100644
--- a/routers/home.go
+++ b/routers/home.go
@@ -273,7 +273,7 @@ func ExploreOrganizations(ctx *context.Context) {
// ExploreCode render explore code page
func ExploreCode(ctx *context.Context) {
if !setting.Indexer.RepoIndexerEnabled {
- ctx.Redirect("/explore", 302)
+ ctx.Redirect(setting.AppSubURL+"/explore", 302)
return
}
diff --git a/templates/user/auth/grant.tmpl b/templates/user/auth/grant.tmpl
index 85c507a74..b67bfa110 100644
--- a/templates/user/auth/grant.tmpl
+++ b/templates/user/auth/grant.tmpl
@@ -13,10 +13,10 @@
-
{{.i18n.Tr "auth.authroize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}
+
{{.i18n.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}
-