Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashPassword ¶
HashPassword hashes a password using bcrypt
func ParseToken ¶
ParseToken validates and parses a JWT token, returning the user ID
Types ¶
type Credentials ¶
type Credentials struct {
Email string `json:"email" form:"email"`
Password string `json:"password" form:"password"`
}
Credentials holds user authentication credentials
func (*Credentials) Authenticate ¶
func (creds *Credentials) Authenticate(hashedPassword string) error
Authenticate compares a password with a stored hash
Click to show internal directories.
Click to hide internal directories.