Documentation ¶
Overview ¶
Package recover implements password reset via e-mail.
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 = "recover_html" EmailRecoverTxt = "recover_txt" PageRecoverStart = "recover_start" PageRecoverMiddle = "recover_middle" PageRecoverEnd = "recover_end" )
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.