MCPcopy
hub / github.com/usefathom/fathom / ComparePassword

Method ComparePassword

pkg/models/user.go:31–33  ·  view source on GitHub ↗

ComparePassword returns true when the given plaintext password matches the encrypted pwd

(pwd string)

Source from the content-addressed store, hash-verified

29
30// ComparePassword returns true when the given plaintext password matches the encrypted pwd
31func (u *User) ComparePassword(pwd string) error {
32 return bcrypt.CompareHashAndPassword([]byte(u.Password), []byte(pwd))
33}

Callers 3

TestNewUserFunction · 0.95
TestUserPasswordFunction · 0.95
CreateSessionMethod · 0.80

Calls

no outgoing calls

Tested by 2

TestNewUserFunction · 0.76
TestUserPasswordFunction · 0.76