diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/handler/auth.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/handler/auth.go b/internal/handler/auth.go index abeebd1..c66eeb7 100644 --- a/internal/handler/auth.go +++ b/internal/handler/auth.go @@ -1 +1,15 @@ package handler + +import ( + "fmt" + + "github.com/go-chi/jwtauth/v5" +) + +var tokenAuth *jwtauth.JWTAuth + +func init() { + tokenAuth = jwtauth.New("HS256", []byte("secret"), nil) + _, tokenString, _ := tokenAuth.Encode(map[string]interface{}{"user_id": 123}) + fmt.Printf("DEBUG: a sample jwt is %s\n\n", tokenString) +} |