Browse Source

Use AppSubUrl for more redirections (#8647) (#8652)

Partial backport without changes to locale files.

Fix #8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template
Fixes /explore and organisation redirection
tags/v1.9.5
zeripath 4 years ago
parent
commit
f9845454cf
3 changed files with 3 additions and 3 deletions
  1. 1
    1
      modules/context/org.go
  2. 1
    1
      routers/home.go
  3. 1
    1
      templates/user/auth/grant.tmpl

+ 1
- 1
modules/context/org.go View File

@@ -62,7 +62,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
}


+ 1
- 1
routers/home.go View File

@@ -272,7 +272,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
}


+ 1
- 1
templates/user/auth/grant.tmpl View File

@@ -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}}">

Loading…
Cancel
Save