summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorNeonXP <i@neonxp.dev>2022-12-20 03:11:37 +0300
committerNeonXP <i@neonxp.dev>2022-12-20 03:11:37 +0300
commite91712e388c530dd5bdfb46f028157a62a60b1e3 (patch)
treefbaf59b83f5502c26bbd0219e8748a2ab01cc6ff /internal
parent746ddc96b848660225d2c2bc10cb0d7b0a0920ee (diff)
iteration
Diffstat (limited to 'internal')
-rw-r--r--internal/handler/auth.go14
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)
+}