Skip to content

Commit b4ee370

Browse files
ChoffaHshaj13
authored andcommitted
chore: creating a new StaticSecret in jwt example expects an Algorithm instead of a Method
1 parent 751bf61 commit b4ee370

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

_examples/jwt/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"net/http"
1212
"time"
1313

14-
gojwt "github.com/dgrijalva/jwt-go/v4"
1514
"github.com/gorilla/mux"
1615
"github.com/shaj13/libcache"
1716
_ "github.com/shaj13/libcache/fifo"
@@ -60,9 +59,9 @@ func getBookAuthor(w http.ResponseWriter, r *http.Request) {
6059

6160
func setupGoGuardian() {
6261
keeper = jwt.StaticSecret{
63-
ID: "secret-id",
64-
Secret: []byte("secret"),
65-
Method: gojwt.SigningMethodHS256,
62+
ID: "secret-id",
63+
Secret: []byte("secret"),
64+
Algorithm: jwt.HS256,
6665
}
6766
cache := libcache.FIFO.New(0)
6867
cache.SetTTL(time.Minute * 5)

0 commit comments

Comments
 (0)