Skip to content

Commit

Permalink
Don't panic when pubkey is empty (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
lincoln-replit authored May 11, 2023
1 parent dfc7692 commit 68e7cd9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ type verifier struct {
}

func (v *verifier) verifyToken(token string, pubkey ed25519.PublicKey) ([]byte, error) {
if len(pubkey) == 0 {
return nil, errors.New("pubkey is empty")
}

var meta string

err := paseto.NewV2().Verify(token, pubkey, &meta, nil)
Expand Down

0 comments on commit 68e7cd9

Please sign in to comment.