From 994bb4e47898959e0c4af363c5b838d128fe3e0a Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Tue, 28 Nov 2023 17:47:00 +0000 Subject: [PATCH] Properly validate registered claims --- mjwt.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mjwt.go b/mjwt.go index 96b00b0..fc1a0af 100644 --- a/mjwt.go +++ b/mjwt.go @@ -63,6 +63,9 @@ func (b *BaseTypeClaims[T]) init() *BaseTypeClaims[T] { // Valid checks the InternalClaimType matches and the type claim type func (b *BaseTypeClaims[T]) Valid() error { + if err := b.RegisteredClaims.Valid(); err != nil { + return err + } if b.ClaimType != b.InternalClaimType() { return ErrClaimTypeMismatch }