aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-10-23 23:27:10 +0100
committertechknowlogick <techknowlogick@gitea.io>2019-10-23 18:27:10 -0400
commit1d10747514477b7b04af57d3835c4939144a6cc3 (patch)
treebf03baa5676d9866597d2480bbb7e3be4542c6ac
parent83c90e9ba00fe86839f5278b0910c64f7d6a677f (diff)
downloadgitea-1d10747514477b7b04af57d3835c4939144a6cc3.tar.gz
gitea-1d10747514477b7b04af57d3835c4939144a6cc3.zip
Use AppSubUrl for more redirections (#8647) (#8651)
Partial backport without changes to locale files. Fix #8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template Fixes /explore and organisation redirection
-rw-r--r--modules/context/org.go2
-rw-r--r--routers/home.go2
-rw-r--r--templates/user/auth/grant.tmpl2
3 files changed, 3 insertions, 3 deletions
diff --git a/modules/context/org.go b/modules/context/org.go
index 4867474334..10791c9d01 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/routers/home.go b/routers/home.go
index f8fb849c8e..eddff28ee9 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 85c507a74a..7ac8f18df7 100644
--- a/templates/user/auth/grant.tmpl
+++ b/templates/user/auth/grant.tmpl
@@ -16,7 +16,7 @@
<p>{{.i18n.Tr "auth.authroize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}</p>
</div>
<div class="ui attached segment">
- <form method="post" action="{{.AppSubUrl}}/login/oauth/grant">
+ <form method="post" action="{{AppSubUrl}}/login/oauth/grant">
{{.CsrfTokenHtml}}
<input type="hidden" name="client_id" value="{{.Application.ClientID}}">
<input type="hidden" name="state" value="{{.State}}">