Documentation ¶
Overview ¶
Package auth provides you functions that let you work with auth. All state is stored in-package. The password is stored hashed, so safe enough.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizedFromRequest ¶
AuthorizedFromRequest is true if the user is authorized.
func CredentialsMatch ¶
CredentialsMatch checks if the credentials match.
func Initialize ¶
func Initialize()
Initialize queries the database for auth information. Call on startup. The module handles all further invocations for you.
func LogInResponse ¶
func LogInResponse(w http.ResponseWriter)
LogInResponse logs such user in and writes a cookie for them.
func LogoutFromRequest ¶
func LogoutFromRequest(w http.ResponseWriter, rq *http.Request)
LogoutFromRequest logs the user in the request out and rewrites the cookie in to an empty one.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.