Documentation ¶
Index ¶
- func DisableTwoFactor(db *gorm.DB, u hide.ID, password string) (bool, error)
- func EnableTwoFactor(db *gorm.DB, u hide.ID, secret string, token string) ([]string, error)
- func GetBackupKeys(db *gorm.DB, authCtx auth.Context) ([]string, error)
- func GetTwoFactor(db *gorm.DB, u hide.ID) (*model.TwoFactor, error)
- func HashPassword(password string) (string, error)
- func IsTwoFactorEnabled(db *gorm.DB, u hide.ID) (bool, error)
- func LoginUser(user *model.User, permissions []*permission.Permission, cfg *config.JWTConfig) (string, error)
- func LoginUserSecure(user *model.User, permissions []*permission.Permission, cfg *config.JWTConfig) (string, error)
- func VerifyPassword(db *gorm.DB, userID hide.ID, password string) bool
- func VerifyTwoFactor(t *model.TwoFactor, token string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableTwoFactor ¶
func EnableTwoFactor ¶
EnableTwoFactor will enable 2FA for the user passed to it if the token validates against the secret
func HashPassword ¶
HashPassword attempts to hash the supplied password
func LoginUser ¶
func LoginUser(user *model.User, permissions []*permission.Permission, cfg *config.JWTConfig) (string, error)
LoginUser generates a signed JWT token
func LoginUserSecure ¶
func LoginUserSecure(user *model.User, permissions []*permission.Permission, cfg *config.JWTConfig) (string, error)
func VerifyPassword ¶
VerifyPassword verifies a password against the stored hash
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.