controllers

package
v0.0.0-...-db47865 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OneTimeCode

type OneTimeCode struct {
	Code           string
	RemainingTries int
	ExpiresAt      time.Time
}

type OneTimeCodeController

type OneTimeCodeController struct {
	// contains filtered or unexported fields
}

func New

func New(db *gorm.DB, config *models.Config) *OneTimeCodeController

New creates an instance of the singleCodeController controller and sets its DB handle

func (*OneTimeCodeController) GenerateSingleUseCode

func (c *OneTimeCodeController) GenerateSingleUseCode(w http.ResponseWriter, r *http.Request)

GenerateSingleUseCode Create a single-usage 6 digits temporary code Useful when a user only has Webauthn MFA, which is specific to a device and browser. Without alternative MFA such as OTP, they would use this temporary code feature

to be allowed to register webauthn on another device or browser.

func (*OneTimeCodeController) ValidateSingleUseCode

func (c *OneTimeCodeController) ValidateSingleUseCode(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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