From 9c69dc7ec831f6aec5dc8eb2db0dda9174c126f6 Mon Sep 17 00:00:00 2001 From: William Petit Date: Wed, 29 Mar 2023 20:49:44 +0200 Subject: [PATCH] feat(auth): use utc time --- internal/auth/agent/jwt.go | 2 +- internal/auth/thirdparty/jwt.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/auth/agent/jwt.go b/internal/auth/agent/jwt.go index b209d40..7ceefe4 100644 --- a/internal/auth/agent/jwt.go +++ b/internal/auth/agent/jwt.go @@ -18,7 +18,7 @@ func GenerateToken(key jwk.Key, thumbprint string) (string, error) { return "", errors.WithStack(err) } - now := time.Now() + now := time.Now().UTC() if err := token.Set(jwt.NotBeforeKey, now); err != nil { return "", errors.WithStack(err) diff --git a/internal/auth/thirdparty/jwt.go b/internal/auth/thirdparty/jwt.go index 2bea305..42ba931 100644 --- a/internal/auth/thirdparty/jwt.go +++ b/internal/auth/thirdparty/jwt.go @@ -42,7 +42,7 @@ func GenerateToken(ctx context.Context, key jwk.Key, issuer, subject string, rol return "", errors.WithStack(err) } - now := time.Now() + now := time.Now().UTC() if err := token.Set(jwt.NotBeforeKey, now); err != nil { return "", errors.WithStack(err)