fix: remove signing key creation (when not found)

This commit is contained in:
Livio Amstutz 2020-10-19 15:26:34 +02:00
parent 4390119d1d
commit 06dcac4c2f
6 changed files with 14 additions and 77 deletions

View file

@ -2,6 +2,7 @@ package utils
import (
"encoding/json"
"errors"
"gopkg.in/square/go-jose.v2"
)
@ -15,6 +16,9 @@ func Sign(object interface{}, signer jose.Signer) (string, error) {
}
func SignPayload(payload []byte, signer jose.Signer) (string, error) {
if signer == nil {
return "", errors.New("missing signer")
}
result, err := signer.Sign(payload)
if err != nil {
return "", err