Categorygithub.com/extark/go_jwt_auth
modulepackage
0.0.1
Repository: https://github.com/extark/go_jwt_auth.git
Documentation: pkg.go.dev

# README

go_jwt_auth

This module is Mantained by Extark and is open source, you can use it for your personal modules.

Methods

func CreateAuthorization(data any, tokenExpireTimeHours int, encryptionKey string) (access string, refresh string, err error)

Returns two JWT tokens and an error (if there is one), one for the access token and the second for the refresh token

# Functions

CreateTokens this method creates an access token and a refresh token and return it.
ExtractAndGetTokenData this method gets the value of the data inside the JWT token and gets a response only if the token is valid.
GetTokenData this method gets the value of the data inside the JWT token and gets a response only if the token is valid.
JwtAuthMiddleware checks if the token is authorized to access at the resources.
JwtCasbinAuthMiddleware makes the same of the JwtAuthMiddleware, buts ad the permissions with casbin on the routes.

# Structs

No description provided by the author