Skip to content

makki0205/gojwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

gojwt

Usage

setting

The default for salt is random The default for exp is 3600 Seconds

jwt.SetSalt("D79998A7-3F2B-4505-BE2B-6E68500AAE37")
jwt.SetExp(60 * 60 * 24)

Generate

claims := map[string]string{
  "user": "nick",
  "email": "nick@github.com",
}
token := jwt.Generate(claims)

Decode

payload, err := jwt.Decode(token)
if err != nil{
	panic(err)
}
fmt.Println(payload["user"])

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages