fix: remove signing key creation (when not found)
This commit is contained in:
parent
4390119d1d
commit
06dcac4c2f
6 changed files with 14 additions and 77 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue