Documentation
¶
Index ¶
- Constants
- Variables
- func NewLoginFormRenderer(customLoginTemplateFile string) (*loginTemplateRenderer, error)
- func ValidateLoginTemplate(templateContent []byte) []error
- type Confirm
- type ConfirmForm
- type ConfirmFormRenderer
- type ConfirmFormValues
- type Login
- type LoginForm
- type LoginFormFields
- type LoginFormRenderer
- type Mux
- type PasswordAuthenticator
- type RequestAuthenticator
Constants ¶
View Source
const LoginTemplateExample = `` /* 1528-byte string literal not displayed */
LoginTemplateExample is a basic template for customizing the login page.
Variables ¶
View Source
var DefaultConfirmFormRenderer = confirmTemplateRenderer{}
Functions ¶
func NewLoginFormRenderer ¶ added in v1.0.6
NewLoginFormRenderer creates a login form renderer that takes in an optional custom template to allow branding of the login page. Uses the default if customLoginTemplateFile is not set.
Types ¶
type Confirm ¶
type Confirm struct {
// contains filtered or unexported fields
}
func NewConfirm ¶
func NewConfirm(csrf csrf.CSRF, auth RequestAuthenticator, render ConfirmFormRenderer) *Confirm
type ConfirmForm ¶
type ConfirmForm struct {
Action string
Error string
User user.Info
Values ConfirmFormValues
}
type ConfirmFormRenderer ¶
type ConfirmFormRenderer interface {
Render(form ConfirmForm, w http.ResponseWriter, req *http.Request)
}
type Login ¶
type Login struct {
// contains filtered or unexported fields
}
func NewLogin ¶
func NewLogin(csrf csrf.CSRF, auth PasswordAuthenticator, render LoginFormRenderer) *Login
func (*Login) Install ¶
Install registers the login handler into a mux. It is expected that the provided prefix will serve all operations. Path MUST NOT end in a slash.
type LoginForm ¶
type LoginForm struct {
Action string
Error string
Names LoginFormFields
Values LoginFormFields
}
type LoginFormFields ¶ added in v1.0.6
type LoginFormRenderer ¶
type LoginFormRenderer interface {
Render(form LoginForm, w http.ResponseWriter, req *http.Request)
}
type Mux ¶
type Mux interface {
Handle(pattern string, handler http.Handler)
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
}
Mux is an object that can register http handlers.
type PasswordAuthenticator ¶
type PasswordAuthenticator interface {
authenticator.Password
handlers.AuthenticationSuccessHandler
}
type RequestAuthenticator ¶
type RequestAuthenticator interface {
authenticator.Request
handlers.AuthenticationSuccessHandler
}
Source Files
¶
- helper.go
- implicit.go
- interfaces.go
- login.go
- templates.go
Click to show internal directories.
Click to hide internal directories.