auth

package
v0.0.0-...-2f442fc Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgUsernameNotFound = "username not found"
	MsgPasswordMismatch = "password hash mismatch"
)
View Source
const (
	MsgErrorCreatingUser   = "error creating user"
	MsgErrorGettingSession = "error getting session"
	MsgErrorSavingSession  = "error saving session"
)

Variables

This section is empty.

Functions

func DeleteAccount

func DeleteAccount(userId uint, password string) error

func GetSessionUser

func GetSessionUser(cookieId string) (*db.User, error)

func IsBadUsernamePasswordError

func IsBadUsernamePasswordError(err error) bool

func IsLoggedIn

func IsLoggedIn(cookieId string) bool

func Login

func Login(cookieId string, username string, password string) error

func Logout

func Logout(cookieId string) error

func Signup

func Signup(cookieId string, username string, password string) error

func UpdatePassword

func UpdatePassword(userId uint, oldPassword string, newPassword string) error

func UserAlreadyExists

func UserAlreadyExists(err error) bool

Reasonable assumption here but error creating user might not mean already exists in edge cases.

Types

This section is empty.

Jump to

Keyboard shortcuts

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