Use AppSubUrl for more redirections (#8647)

Fix #8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template
Fixes /explore and organisation redirection
This commit is contained in:
zeripath 2019-10-23 22:04:22 +01:00 committed by GitHub
parent 22272fe1e4
commit c84174b764
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View file

@ -63,7 +63,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
// Force redirection when username is actually a user. // Force redirection when username is actually a user.
if !org.IsOrganization() { if !org.IsOrganization() {
ctx.Redirect("/" + org.Name) ctx.Redirect(setting.AppSubURL + "/" + org.Name)
return return
} }

View file

@ -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. disable_forgot_password_mail = Account recovery is disabled. Please contact your site administrator.
email_domain_blacklisted = You cannot register with your email address. email_domain_blacklisted = You cannot register with your email address.
authorize_application = Authorize Application 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_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_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? authorize_title = Authorize "%s" to access your account?

View file

@ -273,7 +273,7 @@ func ExploreOrganizations(ctx *context.Context) {
// ExploreCode render explore code page // ExploreCode render explore code page
func ExploreCode(ctx *context.Context) { func ExploreCode(ctx *context.Context) {
if !setting.Indexer.RepoIndexerEnabled { if !setting.Indexer.RepoIndexerEnabled {
ctx.Redirect("/explore", 302) ctx.Redirect(setting.AppSubURL+"/explore", 302)
return return
} }

View file

@ -13,10 +13,10 @@
</p> </p>
</div> </div>
<div class="ui attached segment"> <div class="ui attached segment">
<p>{{.i18n.Tr "auth.authroize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}</p> <p>{{.i18n.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}</p>
</div> </div>
<div class="ui attached segment"> <div class="ui attached segment">
<form method="post" action="{{.AppSubUrl}}/login/oauth/grant"> <form method="post" action="{{AppSubUrl}}/login/oauth/grant">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="client_id" value="{{.Application.ClientID}}"> <input type="hidden" name="client_id" value="{{.Application.ClientID}}">
<input type="hidden" name="state" value="{{.State}}"> <input type="hidden" name="state" value="{{.State}}">