middleware

package
v0.0.0-...-5b5ecee Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireTobeloggedIn

func RequireTobeloggedIn(jwtSecret string) gin.HandlerFunc

Checks if user is has a valid token

func SetUserContext

func SetUserContext(secret string) gin.HandlerFunc

set contex when user has a valid token

Types

type Claim

type Claim struct {
	Email string `json:"email"`
	ID    int    `json:"id"`
	jwt.StandardClaims
}

Claims struct represents the claims in a JWT

Jump to

Keyboard shortcuts

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