File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import (
1616
1717// JwtProtected wrap http handler functions for jwt verification
1818func JwtProtected (publicKey string ) fiber.Handler {
19- fmt .Println (publicKey )
19+ // fmt.Println(publicKey)
2020 pKey := "-----BEGIN PUBLIC KEY-----\n " + insertNewlines (publicKey , int (64 ))+ "\n -----END PUBLIC KEY-----\n "
2121 fmt .Println (pKey )
2222 //
@@ -29,7 +29,7 @@ func JwtProtected(publicKey string) fiber.Handler {
2929 } else {
3030 tokenString := authHeader [1 ]
3131 // need to fix this metod
32- isOk , token , err := verifyJWT_RSA (tokenString , []byte (publicKey ))
32+ isOk , token , err := verifyJWT_RSA (tokenString , []byte (pKey ))
3333 if err != nil || ! isOk {
3434 return c .Status (http .StatusUnauthorized ).JSON (models .ApiDefaultError (fmt .Sprintf ("error during verify jwt, err: %s" , err .Error ())))
3535 }
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ require (
3737 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
3838 github.com/go-redis/redis/v8 v8.11.5
3939 github.com/gofiber/fiber/v2 v2.46.0
40- github.com/golang-jwt/jwt/v4 v4.5.0
40+ github.com/golang-jwt/jwt/v4 v4.4.3
4141 go.uber.org/atomic v1.7.0 // indirect
4242 go.uber.org/multierr v1.6.0 // indirect
4343 golang.org/x/net v0.8.0 // indirect
You can’t perform that action at this time.
0 commit comments