Documentation ¶
Overview ¶
Package recoverable takes care of resetting a user's password and sending reset instructions via email
Index ¶
- Constants
- func GenerateRecoverCreds() (selector, verifier, token string, err error)
- type Recover
- func (r *Recover) EndGet(w http.ResponseWriter, req *http.Request) error
- func (r *Recover) EndPost(w http.ResponseWriter, req *http.Request) error
- func (r *Recover) Init(ab *authboss.Authboss) (err error)
- func (r *Recover) SendRecoverEmail(ctx context.Context, to, encodedToken string)
- func (r *Recover) StartGet(w http.ResponseWriter, req *http.Request) error
- func (r *Recover) StartPost(w http.ResponseWriter, req *http.Request) error
Constants ¶
const ( DataRecoverToken = "recover_token" DataRecoverURL = "recover_url" FormValueToken = "token" EmailRecoverHTML = "mailer/recover.html.tpl" EmailRecoverTxt = "mailer/recover.text.tpl" PageRecoverStart = "recover_start.html.tpl" PageRecoverMiddle = "recover_middle.html.tpl" PageRecoverEnd = "recover_end.html.tpl" )
Constants for templates etc.
Variables ¶
This section is empty.
Functions ¶
func GenerateRecoverCreds ¶
GenerateRecoverCreds generates pieces needed for user recovery selector: hash of the first half of a 64 byte value (to be stored in the database and used in SELECT query) verifier: hash of the second half of a 64 byte value (to be stored in database but never used in SELECT query) token: the user-facing base64 encoded selector+verifier
Types ¶
type Recover ¶
Recover module
func (*Recover) EndGet ¶
EndGet shows a password recovery form, and it should have the token that the user brought in the query parameters in it on submission.
func (*Recover) SendRecoverEmail ¶
SendRecoverEmail to a specific e-mail address passing along the encodedToken in an escaped URL to the templates.