auth

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const UserSessionVar = "GoraddUserId" // Change this to a unique session variable name for your application

Variables

This section is empty.

Functions

func CurrentUser

func CurrentUser(ctx context.Context) *model.Person

CurrentUser returns the currently logged in user object, or nil if no user is logged in. It will cache the user information and store it in the context for future reference in the current request, so that the database does not need to be queried each time. It gets the current user out of the sesssion. If there is no current user, it returns nil.

func Logout

func Logout(ctx context.Context)

Logout does the steps required to log out the current user

func SetCurrentUserID

func SetCurrentUserID(ctx context.Context, id string)

func ValidatePassword

func ValidatePassword(password string, userName string) bool

ValidatePassword enforces the rules about what makes up a good enough password for our system We are using a 3rd party library to evaluate password strength. This same library is available in javascript, but this is a server side check.

Types

This section is empty.

Jump to

Keyboard shortcuts

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