otp

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCheckOTPStatus

func HandleCheckOTPStatus(req *CheckOTPStatus) (*models.OTP, error)

HandleCheckOTPStatus checks the user input against a stored OTP.

func HandleVerifyOTP

func HandleVerifyOTP(req *VerifyOTPRequest) (*models.OTP, error)

HandleVerifyOTP checks the user input against a stored OTP.

Types

type CheckOTPStatus

type CheckOTPStatus struct {
	Namespace string
	Provider  string
	ID        string
	OTPVal    string
	Lo        *logf.Logger
	Store     store.Store
}

type OTPResp

type OTPResp struct {
	models.OTP
	URL string `json:"url"`
}

func HandleSetOTP

func HandleSetOTP(req SetOTPRequest) (*OTPResp, error)

HandleSetOTP creates a new OTP while respecting maximum attempts and TTL values.

type SetOTPRequest

type SetOTPRequest struct {
	// The URL where the server is running
	RootURL            string
	Namespace          string
	Provider           string
	ID                 string
	To                 string
	OtpTTL             time.Duration
	RawMaxAttempts     int
	Extra              []byte
	SMTPConfig         *smtp.Config
	HTMLTemplateName   string
	Lo                 *logf.Logger
	Store              store.Store
	ChannelDescription string
	AddressDescription string
}

type VerifyOTPRequest

type VerifyOTPRequest struct {
	Namespace string
	Provider  string
	ID        string
	OTPVal    string
	Lo        *logf.Logger
	Store     store.Store
}

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL