From e91712e388c530dd5bdfb46f028157a62a60b1e3 Mon Sep 17 00:00:00 2001 From: NeonXP Date: Tue, 20 Dec 2022 03:11:37 +0300 Subject: iteration --- internal/handler/auth.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'internal') 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) +} -- cgit v1.2.3