reset_token

package
v0.0.0-...-ac733a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2017 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResetToken

type ResetToken struct {
	Id      string `json:"-" sql:"id"`
	Created int64  `json:"-" sql:"created"`
	Updated int64  `json:"-" sql:"updated"`
	Email   string `json:"-" sql:"email"`
	Used    bool   `json:"-" sql:"used"`
}

a user reset token

func CreateResetToken

func CreateResetToken(db sqlutil.Execable, email string) (*ResetToken, error)

create a reset token

func (*ResetToken) Consume

func (r *ResetToken) Consume(db sqlutil.Execable, password string) (*user.User, error)

use the token to reset the user's password, returning the updated user

func (*ResetToken) Read

func (t *ResetToken) Read(db *sql.DB) error

read a token

func (*ResetToken) Usable

func (r *ResetToken) Usable() error

returns nil if the token is usable, otherwise returns an error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL