fix: wrap original fetch key error

This commit is contained in:
Elio Bischof 2021-03-02 23:58:34 +01:00
parent 53803642d6
commit f2f509a522
No known key found for this signature in database
GPG key ID: 7B383FDE4DDBF1BD

View file

@ -3,6 +3,7 @@ package op
import ( import (
"context" "context"
"errors" "errors"
"fmt"
"time" "time"
"gopkg.in/square/go-jose.v2" "gopkg.in/square/go-jose.v2"
@ -91,7 +92,7 @@ func (k *jwtProfileKeySet) VerifySignature(ctx context.Context, jws *jose.JSONWe
} }
key, err := k.Storage.GetKeyByIDAndUserID(ctx, keyID, k.userID) key, err := k.Storage.GetKeyByIDAndUserID(ctx, keyID, k.userID)
if err != nil { if err != nil {
return nil, errors.New("error fetching keys") return nil, fmt.Errorf("error fetching keys: %w", err)
} }
payload, err, ok := oidc.CheckKey(keyID, jws, *key) payload, err, ok := oidc.CheckKey(keyID, jws, *key)
if !ok { if !ok {