middleware

package
v0.0.0-...-b901195 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowAuth

func AllowAuth(c *gin.Context)

AllowAuth Allows user authentication but does not require it. This middleware fails in the event that the user passes in an invalid token OR some other error

func RequireAuth

func RequireAuth(c *gin.Context)

RequireAuth Middleware authentication function

Types

type JWTClaims

type JWTClaims struct {
	UserId   int    `json:"user_id"`
	Username string `json:"username"`
	jwt.RegisteredClaims
}

Jump to

Keyboard shortcuts

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