Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateBackupCodes ¶
func HashBackupCodes ¶
func VerifyBackupCode ¶
Types ¶
type BackupCodeStore ¶
type BackupCodeStore struct {
// contains filtered or unexported fields
}
func NewBackupCodeStore ¶
func NewBackupCodeStore() *BackupCodeStore
func (*BackupCodeStore) RemainingCodes ¶
func (s *BackupCodeStore) RemainingCodes(userID uint) int
func (*BackupCodeStore) SetCodes ¶
func (s *BackupCodeStore) SetCodes(userID uint, codes []string)
func (*BackupCodeStore) VerifyCode ¶
func (s *BackupCodeStore) VerifyCode(userID uint, code string) bool
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService() *Service
func (*Service) EnableTwoFactor ¶
func (s *Service) EnableTwoFactor(accountID uint, accountName, phone string) (*TwoFactorSecret, error)
func (*Service) VerifyToken ¶
type TwoFactorConfig ¶
type TwoFactorSecret ¶
type TwoFactorSecret struct {
AccountName string
Issuer string
Secret string
QRCodeURL string
CreatedAt time.Time
}
func GenerateSecret ¶
func GenerateSecret(accountName, issuer string) (*TwoFactorSecret, error)
Click to show internal directories.
Click to hide internal directories.