1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-12-13 23:35:50 +02:00

Custom footer text (optional)

Closes #256 and #166
This commit is contained in:
Jehiah Czebotar
2016-06-18 23:53:42 -04:00
parent 168cff9d4b
commit 57f82ed71e
4 changed files with 11 additions and 1 deletions

View File

@@ -66,6 +66,7 @@ type OAuthProxy struct {
skipAuthRegex []string
compiledRegex []*regexp.Regexp
templates *template.Template
Footer string
}
type UpstreamProxy struct {
@@ -199,6 +200,7 @@ func NewOAuthProxy(opts *Options, validator func(string) bool) *OAuthProxy {
SkipProviderButton: opts.SkipProviderButton,
CookieCipher: cipher,
templates: loadTemplates(opts.CustomTemplatesDir),
Footer: opts.Footer,
}
}
@@ -345,6 +347,7 @@ func (p *OAuthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code
Redirect string
Version string
ProxyPrefix string
Footer template.HTML
}{
ProviderName: p.provider.Data().ProviderName,
SignInMessage: p.SignInMessage,
@@ -352,6 +355,7 @@ func (p *OAuthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code
Redirect: redirect_url,
Version: VERSION,
ProxyPrefix: p.ProxyPrefix,
Footer: template.HTML(p.Footer),
}
p.templates.ExecuteTemplate(rw, "sign_in.html", t)
}