Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BcryptAuth ¶
example implementation of a Revel auth security driver This driver should be embedded into your app-level User model It expects your User model to have `Password` and `HashedPassword` string fields
Your User model also needs to set itself as the UserContext for the BcryptAuth driver ¶
func NewUser(email, pass string) *User { u := &User{ email: email, password: pass, } u.UserContext = u }
func (*BcryptAuth) Authenticate ¶
func (self *BcryptAuth) Authenticate() (bool, error)
Bycrypt Authenticate() expects a single string argument of the plaintext password It returns true on success and false if error or password mismatch
func (*BcryptAuth) HashSecret ¶
func (self *BcryptAuth) HashSecret(args ...interface{}) (string, error)
Bcrypt Secret() returns the hashed version of the password. It expects an argument of type string, which is the plain text password
Click to show internal directories.
Click to hide internal directories.