Skip to content

Commit 1d10747

Browse files
zeripathtechknowlogick
authored andcommitted
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
1 parent 83c90e9 commit 1d10747

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

modules/context/org.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
6363

6464
// Force redirection when username is actually a user.
6565
if !org.IsOrganization() {
66-
ctx.Redirect("/" + org.Name)
66+
ctx.Redirect(setting.AppSubURL + "/" + org.Name)
6767
return
6868
}
6969

routers/home.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func ExploreOrganizations(ctx *context.Context) {
273273
// ExploreCode render explore code page
274274
func ExploreCode(ctx *context.Context) {
275275
if !setting.Indexer.RepoIndexerEnabled {
276-
ctx.Redirect("/explore", 302)
276+
ctx.Redirect(setting.AppSubURL+"/explore", 302)
277277
return
278278
}
279279

templates/user/auth/grant.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<p>{{.i18n.Tr "auth.authroize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}</p>
1717
</div>
1818
<div class="ui attached segment">
19-
<form method="post" action="{{.AppSubUrl}}/login/oauth/grant">
19+
<form method="post" action="{{AppSubUrl}}/login/oauth/grant">
2020
{{.CsrfTokenHtml}}
2121
<input type="hidden" name="client_id" value="{{.Application.ClientID}}">
2222
<input type="hidden" name="state" value="{{.State}}">

0 commit comments

Comments
 (0)