Check authentication from jwt on all routes

This commit is contained in:
2025-10-03 19:51:50 +02:00
parent f20e177480
commit 6e189d2ff0
4 changed files with 59 additions and 4 deletions

View File

@@ -1,15 +1,12 @@
package jwtauth
import (
"encoding/base64"
"os"
"github.com/golang-jwt/jwt/v5"
)
func GenerateJwtToken(username string) (string, error) {
var s string
key, err := base64.URLEncoding.DecodeString(os.Getenv(getKeyVariableName()))
key, err := GetJwtKey()
if err != nil {
return s, err
}