jwt

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Issuer string = "Apisense WEB-API"

Issuer holds the issuer of the token

Variables

This section is empty.

Functions

func ExtractUidFromHeader

func ExtractUidFromHeader(c *fiber.Ctx) string

ExtractUidFromHeader extracts the uid from the token in the Authorization header

func ExtractUidFromToken

func ExtractUidFromToken(token *jwt.Token) string

ExtractUidFromToken extracts the uid from a given token

func GenerateToken

func GenerateToken(uid string) (string, error)

GenerateToken generates a new token for the given user

func RefreshToken

func RefreshToken(token string, userId string) (string, error)

RefreshToken takes a valid token and generates a new one from it

func ValidateToken

func ValidateToken(encodedToken string) (*jwt.Token, error)

ValidateToken validates if the given token is valid. Returns the decoded token

Types

This section is empty.

Jump to

Keyboard shortcuts

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