jwtutil

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasRole

func HasRole(ctx *gin.Context, role string) bool

HasRole checks if the user has the specified role in their JWT token. It retrieves the JWT claims from the context and checks if the user has the required role. Only types that implement jwtclaims.ClaimsWithRoles are supported (which includes *jwtclaims.Claims).

Types

This section is empty.

Jump to

Keyboard shortcuts

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