Documentation
¶
Overview ¶
Package auth provides password hashing and verification.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTOTPSecret ¶ added in v0.10.0
GenerateTOTPSecret generates a random base32-encoded TOTP secret (160 bits).
func GenerateTOTPURI ¶ added in v0.10.0
GenerateTOTPURI builds an otpauth:// URI for use with authenticator apps.
func HashPassword ¶
HashPassword hashes a plaintext password using bcrypt with a cost of 10.
func ValidateTOTP ¶ added in v0.10.0
ValidateTOTP checks a 6-digit code against a TOTP secret. Checks current, previous, and next time step to allow for clock drift.
func VerifyPassword ¶
VerifyPassword compares a plaintext password against a bcrypt hash. Returns true if the password matches the hash.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.