login

package
v3.7.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2018 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const LoginTemplateExample = `` /* 1629-byte string literal not displayed */

LoginTemplateExample is a basic template for customizing the login page.

Variables

This section is empty.

Functions

func NewLoginFormRenderer

func NewLoginFormRenderer(customLoginTemplateFile string) (*loginTemplateRenderer, error)

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.

func ValidateLoginTemplate

func ValidateLoginTemplate(templateContent []byte) []error

Types

type Login

type Login struct {
	// contains filtered or unexported fields
}

func NewLogin

func NewLogin(provider string, csrf csrf.CSRF, auth PasswordAuthenticator, render LoginFormRenderer) *Login

func (*Login) Install

func (l *Login) Install(mux Mux, paths ...string)

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.

func (*Login) ServeHTTP

func (l *Login) ServeHTTP(w http.ResponseWriter, req *http.Request)

type LoginForm

type LoginForm struct {
	ProviderName string

	Action string

	Error     string
	ErrorCode string

	Names  LoginFormFields
	Values LoginFormFields
}

type LoginFormFields

type LoginFormFields struct {
	Then     string
	CSRF     string
	Username string
	Password string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL