utils

package
v0.0.0-...-d7b6ce4 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHOTP

func GenerateHOTP(counter uint64) (string, error)

func GenerateToken

func GenerateToken(claims *Claims) string

generate tokens used for auth

func ValidateOTP

func ValidateOTP(otp string, counter uint64) bool

Types

type Claims

type Claims struct {
	jwt.RegisteredClaims

	Uid      uint   `json:"uid"`
	Username string `json:"username"`
	AuthMode string `json:"authmode"`
}

func JwtVerify

func JwtVerify(tokenStr string) (*Claims, error)

verify token

Jump to

Keyboard shortcuts

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