Skip to content

Commit

Permalink
update error message
Browse files Browse the repository at this point in the history
  • Loading branch information
v9n committed Dec 12, 2024
1 parent 89cca78 commit c383627
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions aggregator/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ func (r *RpcServer) GetKey(ctx context.Context, payload *avsproto.GetKeyReq) (*a

if strings.Contains(payload.Signature, ".") {
authenticated, err := auth.VerifyJwtKeyForUser(r.config.JwtSecret, payload.Signature, submitAddress)
if err != nil {
return nil, err
}

if !authenticated {
return nil, status.Errorf(codes.Unauthenticated, auth.InvalidAPIKey)
if err != nil || !authenticated {
return nil, status.Errorf(codes.Unauthenticated, "%s: %s", auth.AuthenticationError, auth.InvalidAPIKey)
}
} else {
// We need to have 3 things to verify the signature: the signature, the hash of the original data, and the public key of the signer. With this information we can determine if the private key holder of the public key pair did indeed sign the message
Expand Down

0 comments on commit c383627

Please sign in to comment.