Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) ConsumePendingSetup(ctx context.Context, userID, token string) (string, error)
- func (c *Client) ConsumeRecoveryCode(ctx context.Context, userID, code string) (bool, error)
- func (c *Client) CreateRecoveryCodes(ctx context.Context, userID string) ([]string, error)
- func (c *Client) GenerateTOTPSetup(accountLabel string) (*otp.Key, error)
- func (c *Client) HasTwoFactorEnabled(ctx context.Context, userID string) (bool, error)
- func (c *Client) LoadPendingSetupSecret(ctx context.Context, userID, token string) (string, error)
- func (c *Client) LoadUserTOTPSecret(ctx context.Context, userID string) (string, error)
- func (c *Client) StartPendingSetup(ctx context.Context, userID, secret string) (string, error)
- func (c *Client) UpsertUserTOTPSecret(ctx context.Context, userID, secret string) error
- func (c *Client) VerifyTOTPCode(secret, code string, now time.Time) bool
- type ClientConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidTwoFactorCode = errors.New("invalid two-factor code")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cfg ClientConfig) (*Client, error)
func (*Client) ConsumePendingSetup ¶
func (*Client) ConsumeRecoveryCode ¶
func (*Client) CreateRecoveryCodes ¶
func (*Client) GenerateTOTPSetup ¶
func (*Client) HasTwoFactorEnabled ¶
func (*Client) LoadPendingSetupSecret ¶
func (*Client) LoadUserTOTPSecret ¶
func (*Client) StartPendingSetup ¶
func (*Client) UpsertUserTOTPSecret ¶
Click to show internal directories.
Click to hide internal directories.