fix: error wrapping
Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
parent
9d36542183
commit
293521a01c
|
|
@ -235,13 +235,15 @@ func (t *ticket) makeCookie(req *http.Request, value string, expires time.Durati
|
|||
if value != "" {
|
||||
secret, err := t.options.GetSecret()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("retrieving secret failed: %w", err)
|
||||
}
|
||||
|
||||
value, err = encryption.SignedValue(secret, t.options.Name, []byte(value), now)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("signing cookie value failed: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return cookies.MakeCookieFromOptions(
|
||||
req,
|
||||
t.options.Name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue