Documentation
¶
Index ¶
- Variables
- func Authenticate(r *http.Request) (string, error)
- func GenerateHashedPassword(password string) string
- func GenerateSessionToken() string
- func IsPasswordCorrect(password string, hashedPassword string) bool
- func LogOut(r *http.Request)
- func SignIn(username string, password string) (db.SessionIdentity, error)
- func SignUp(username string, password string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRetrievingSessionToken = errors.New("Could not retrieve a session cookie") ErrInvalidSessionToken = errors.New("Session token is invalid") )
View Source
var ErrLoginAttemptUnsuccessful = errors.New("Login attempt unsuccessful")
Functions ¶
func Authenticate ¶
Authenticate checks if the session token belongs to a user
func GenerateHashedPassword ¶
GenerateHashedPassword creates a new hashed password
func GenerateSessionToken ¶
func GenerateSessionToken() string
GenerateSessionToken creates a random session token
func IsPasswordCorrect ¶
IsPasswordCorrect compares a password with a hashedPassword
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.