Fix pedantic string check for nul in access token generator command.

This commit is contained in:
Captain ALM 2024-06-09 20:46:25 +01:00
parent d76a534346
commit a0d03c0dfb
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

View File

@ -67,7 +67,7 @@ func (s *accessCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}
} }
var token string var token string
if len(s.kID) == 1 && s.kID[0] == '\x00' { if s.kID == "\x00" {
signer := mjwt.NewMJwtSigner(s.issuer, key) signer := mjwt.NewMJwtSigner(s.issuer, key)
token, err = signer.GenerateJwt(s.subject, s.id, aud, dur, auth.AccessTokenClaims{Perms: ps}) token, err = signer.GenerateJwt(s.subject, s.id, aud, dur, auth.AccessTokenClaims{Perms: ps})
} else { } else {