diff --git a/services/context/context_response.go b/services/context/context_response.go index c4b7fd1d1c..68546e0b12 100644 --- a/services/context/context_response.go +++ b/services/context/context_response.go @@ -169,6 +169,18 @@ func (ctx *Context) notFoundInternal(logMsg string, logErr error) { ctx.Data["IsRepo"] = ctx.Repo.Repository != nil ctx.Data["Title"] = "Page Not Found" ctx.Data["ErrorMsg"] = "" // FIXME: the template never renders this message, need to fix in the future (and show safe messages to end users) + ctx.Data["CurrentURL"] = ctx.Req.URL.RequestURI() + + // Load OAuth2 providers for the login form on error pages + if !ctx.IsSigned { + oauth2Providers, err := oauth2.GetOAuth2Providers(ctx, optional.Some(true)) + if err != nil { + log.Error("NotFound: GetOAuth2Providers: %v", err) + } + ctx.Data["OAuth2Providers"] = oauth2Providers + ctx.Data["EnableSSPI"] = auth_model.IsSSPIEnabled(ctx) + } + ctx.HTML(http.StatusNotFound, "status/404") } diff --git a/templates/status/403.tmpl b/templates/status/403.tmpl index fdb2146177..9ef55ec26e 100644 --- a/templates/status/403.tmpl +++ b/templates/status/403.tmpl @@ -10,10 +10,6 @@ {{if not .IsSigned}}