diff --git a/services/context/context_response.go b/services/context/context_response.go index ed238f0376..52737923bb 100644 --- a/services/context/context_response.go +++ b/services/context/context_response.go @@ -186,6 +186,7 @@ func (ctx *Context) Forbidden() { ctx.Data["IsRepo"] = ctx.Repo.Repository != nil ctx.Data["Title"] = "Access Denied" + ctx.Data["CurrentURL"] = ctx.Req.URL.RequestURI() ctx.HTML(http.StatusForbidden, "status/403") } diff --git a/templates/status/403.tmpl b/templates/status/403.tmpl index 05eaa9dccc..fe6e58faa0 100644 --- a/templates/status/403.tmpl +++ b/templates/status/403.tmpl @@ -7,10 +7,24 @@
403 Access Denied
{{if .AccessDeniedPrompt}}{{.AccessDeniedPrompt}}{{else}}{{ctx.Locale.Tr "error403"}}{{end}}
- {{if not .IsSigned}} - {{ctx.Locale.Tr "sign_in"}} - {{end}}
+ {{if not .IsSigned}} +
+
+ {{.CsrfTokenHtml}} + +
+ + +
+
+ + +
+ +
+
+ {{end}}