otp_service

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IService

type IService interface {
	// ValidateOTP validate the given request that should have otp code inside.
	// Should always return false either for invalid token or any error in
	// order to verify the otp code.
	ValidateOTP(context.Context, *req.OTP) bool
	// GetJWT return the string encoded jwt token that's ready to be served to
	// response, also return error if any.
	GetJWT(context.Context) (string, error)
}

IService an interface that should be used when dealing with otp.

func New

New return new service that can be used to exchange otp code with a JWT that has validity based on the config.

Jump to

Keyboard shortcuts

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