Properly validate registered claims

This commit is contained in:
Melon 2023-11-28 17:47:00 +00:00
parent 9a859eb2d7
commit 994bb4e478
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -63,6 +63,9 @@ func (b *BaseTypeClaims[T]) init() *BaseTypeClaims[T] {
// Valid checks the InternalClaimType matches and the type claim type // Valid checks the InternalClaimType matches and the type claim type
func (b *BaseTypeClaims[T]) Valid() error { func (b *BaseTypeClaims[T]) Valid() error {
if err := b.RegisteredClaims.Valid(); err != nil {
return err
}
if b.ClaimType != b.InternalClaimType() { if b.ClaimType != b.InternalClaimType() {
return ErrClaimTypeMismatch return ErrClaimTypeMismatch
} }