auth

package
v0.0.0-...-3dc2fc1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(next http.HandlerFunc) http.HandlerFunc

func GenerateJWT

func GenerateJWT(username string) (string, error)

GenerateJWT generates a new JWT token for a given username

func IsAuthorized

func IsAuthorized(r *http.Request) bool

func ValidateUser

func ValidateUser(username, password string) bool

This is a placeholder for the actual login logic. You need to replace it with your own login validation logic.

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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