// Recover checks whether the provided Token is valid and sets the provided
// password as the new account password.
// NOTE: provided Token must be in its original / raw form - not combined
// with user's ID (as InitRecovery method returns).
Recover checks whether the provided Token is valid and sets the provided
password as the new account password.
NOTE: provided Token must be in its original / raw form - not combined
with user's ID (as InitRecovery method returns).
// Recover checks whether the provided Token is valid and sets the provided // password as the new account password . // NOTE : provided Token must be in its original / raw form - not combined // with user ' s ID ( as InitRecovery method returns ) .
func (c *Core) Recover(t, p string) error {
	if err := c.Recovery.Check(t); err != nil {
		return err
	}
	res, err := c.SetPassword(p)
	if err != nil {
		return err
	}
	if !res {
		return ErrInvalidPassword
	}
	c.Recovery.Clear()
	return nil
}
func ( c * Core ) Recover ( t , p string ) error { if err := c . Recovery . Check ( t ) ; err != nil { return err } res , err := c . SetPassword ( p ) if err != nil { return err } if ! res { return ErrInvalidPassword } c . Recovery . Clear ( ) return nil }
Recover checks whether the provided Token is valid and sets the provided
password as the new account password.
Recover checks whether the provided Token is valid and sets the provided password as the new account password .