mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 19:32:26 +00:00
add iat to jwt
This commit is contained in:
@@ -38,6 +38,7 @@ func jwtEncode(L *lua.LState) int {
|
|||||||
payload.ForEach(func(key, value lua.LValue) {
|
payload.ForEach(func(key, value lua.LValue) {
|
||||||
claims[key.String()] = ConvertLuaTypesToGolang(value)
|
claims[key.String()] = ConvertLuaTypesToGolang(value)
|
||||||
})
|
})
|
||||||
|
claims["iat"] = time.Now().Unix()
|
||||||
claims["exp"] = time.Now().Add(expDuration).Unix()
|
claims["exp"] = time.Now().Add(expDuration).Unix()
|
||||||
|
|
||||||
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
|
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
|
||||||
|
|||||||
Reference in New Issue
Block a user