Update authority/provisioner/claims.go

Co-authored-by: Mariano Cano <mariano@smallstep.com>
This commit is contained in:
Max 2022-08-23 21:35:11 -07:00 committed by max furman
parent ab0d2503ae
commit 2de7d3fcf0
No known key found for this signature in database

View File

@ -38,8 +38,10 @@ type Claimer struct {
// NewClaimer initializes a new claimer with the given claims.
func NewClaimer(claims *Claims, global Claims) (*Claimer, error) {
c := &Claimer{global: global, claims: claims}
err := c.Validate()
return c, err
if err := c.Validate(); err != nil {
return nil, err
}
return c, nil
}
// Claims returns the merge of the inner and global claims.