auth

package
v0.0.0-...-a5fc328 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingRegisterValues       = errors.New("Username, password or password confirmation not provided")
	ErrPasswordsDontMatch          = errors.New("Passwords do not match")
	ErrUsernameTooShort            = errors.New("Username must be at least 6 characters")
	ErrPasswordTooShort            = errors.New("Password must be at least 6 characters")
	ErrUsernameAlreadyInUse        = errors.New("The username is already in use")
	ErrUserRegistrationUnavailable = errors.New("User registering is unavailable")
)

Functions

func Authenticator

func Authenticator(c *gin.Context) (interface{}, error)

func Authorizator

func Authorizator(data interface{}, c *gin.Context) bool

func IdentityHandler

func IdentityHandler(c *gin.Context) interface{}

func Middleware

func Middleware() (*jwt.GinJWTMiddleware, error)

func Payload

func Payload(data interface{}) jwt.MapClaims

func Unauthorized

func Unauthorized(c *gin.Context, code int, message string)

Types

type Controller

type Controller struct{}

func (*Controller) Register

func (controller *Controller) Register(c *gin.Context)

Jump to

Keyboard shortcuts

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