Skip to content

Commit

Permalink
Use AppSubUrl for more redirections (#8647) (#8651)
Browse files Browse the repository at this point in the history
Partial backport without changes to locale files.

Fix #8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template
Fixes /explore and organisation redirection
  • Loading branch information
zeripath authored and techknowlogick committed Oct 23, 2019
1 parent 83c90e9 commit 1d10747
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/context/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion routers/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion templates/user/auth/grant.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}">
Expand Down

0 comments on commit 1d10747

Please sign in to comment.