Documentation ¶
Overview ¶
Package remember implements persistent logins using cookies
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
Authenticate the user using their remember cookie. If the cookie proves unusable it will be deleted. A cookie may be unusable for the following reasons: - Can't decode the base64 - Invalid token format - Can't find token in DB
In order to authenticate it adds to the request context as well as to the cookie and session states.
func GenerateToken ¶
GenerateToken creates a remember me token
Types ¶
type Remember ¶
Remember module
func (*Remember) AfterPasswordReset ¶
func (r *Remember) AfterPasswordReset(w http.ResponseWriter, req *http.Request, handled bool) (bool, error)
AfterPasswordReset is called after the password has been reset, since it should invalidate all tokens associated to that user.
func (*Remember) RememberAfterAuth ¶
func (r *Remember) RememberAfterAuth(w http.ResponseWriter, req *http.Request, handled bool) (bool, error)
RememberAfterAuth creates a remember token and saves it in the user's cookies.