auth

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(userID uint) (string, error)

GenerateToken creates a signed JWT for the given user ID. Reads JWT_SECRET and JWT_EXPIRY (seconds) from environment.

func ValidateToken

func ValidateToken(tokenStr string) (jwt.MapClaims, error)

ValidateToken parses and validates a JWT string. Returns the claims if the token is valid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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