From 6fba17460600261f0450468ab3b048789a423703 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 20 Jan 2022 03:05:06 +0800 Subject: [PATCH] Fix incorrect OAuth message (#18332) As the title, Fix #18327 --- routers/web/auth/oauth.go | 2 +- templates/user/auth/grant.tmpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index 65ab9f358e..fa2b0aa65f 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -477,7 +477,7 @@ func AuthorizeOAuth(ctx *context.Context) { ctx.Data["State"] = form.State ctx.Data["Scope"] = form.Scope ctx.Data["Nonce"] = form.Nonce - ctx.Data["ApplicationUserLink"] = "@" + html.EscapeString(user.Name) + "" + ctx.Data["ApplicationUserLinkHTML"] = "@" + html.EscapeString(user.Name) + "" ctx.Data["ApplicationRedirectDomainHTML"] = "" + html.EscapeString(form.RedirectURI) + "" // TODO document SESSION <=> FORM err = ctx.Session.Set("client_id", app.ClientID) diff --git a/templates/user/auth/grant.tmpl b/templates/user/auth/grant.tmpl index 2f8dffb52e..0f072bcf13 100644 --- a/templates/user/auth/grant.tmpl +++ b/templates/user/auth/grant.tmpl @@ -9,11 +9,11 @@ {{template "base/alert" .}}

{{.i18n.Tr "auth.authorize_application_description"}}
- {{.i18n.Tr "auth.authorize_application_created_by" (.ApplicationUserLink|Escape) | Str2html}} + {{.i18n.Tr "auth.authorize_application_created_by" .ApplicationUserLinkHTML | Str2html}}

-

{{.i18n.Tr "auth.authorize_redirect_notice" (.ApplicationRedirectDomainHTML|Escape) | Str2html}}

+

{{.i18n.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}