feat(authn): add templatized error page
Some checks reported errors
Cadoles/bouncer/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
Cadoles/bouncer/pipeline/head Something is wrong with the build of this commit
ref CNOUS/mse#3907
This commit is contained in:
@ -2,6 +2,7 @@ package authn
|
||||
|
||||
type Options struct {
|
||||
TemplateDir string
|
||||
Debug bool
|
||||
}
|
||||
|
||||
type OptionFunc func(*Options)
|
||||
@ -9,6 +10,7 @@ type OptionFunc func(*Options)
|
||||
func NewOptions(funcs ...OptionFunc) *Options {
|
||||
opts := &Options{
|
||||
TemplateDir: "./templates",
|
||||
Debug: false,
|
||||
}
|
||||
|
||||
for _, fn := range funcs {
|
||||
@ -23,3 +25,9 @@ func WithTemplateDir(templateDir string) OptionFunc {
|
||||
o.TemplateDir = templateDir
|
||||
}
|
||||
}
|
||||
|
||||
func WithDebug(debug bool) OptionFunc {
|
||||
return func(o *Options) {
|
||||
o.Debug = debug
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user