Merge pull request #87 from caos/wrap-original-error

fix: wrap original fetch key error
This commit is contained in:
Elio Bischof 2021-03-03 00:00:00 +01:00 committed by GitHub
commit 527dd7b604
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ package op
import (
"context"
"errors"
"fmt"
"time"
"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)
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)
if !ok {