auth

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaybeWithUser

func MaybeWithUser(fn UserHandlerFunc, appCtx *appctx.Context) http.Handler

MaybeWithUser retrieves the connected user and calls the provided function with the user. If the user is not connected, user is nil.

func WithUserOr403 added in v0.8.0

func WithUserOr403(fn UserHandlerFunc, appCtx *appctx.Context) http.Handler

WithUserOr403 promises to call the provided function with a non-nil user. Other requests are responded with a 403

func WithUserOrRedirect added in v0.8.0

func WithUserOrRedirect(fn UserHandlerFunc, appCtx *appctx.Context) http.Handler

WithUserOrRedirect promises to call the provided function with a non-nil user. Other requests are redirected to the login page

Types

type UserHandlerFunc

type UserHandlerFunc = func(http.ResponseWriter, *http.Request, *models.User)

UserHandlerFunc is net/http HandlerFunc with an additional User parameter

Jump to

Keyboard shortcuts

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