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 != "" {
|
if value != "" {
|
||||||
secret, err := t.options.GetSecret()
|
secret, err := t.options.GetSecret()
|
||||||
if err != nil {
|
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)
|
value, err = encryption.SignedValue(secret, t.options.Name, []byte(value), now)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("signing cookie value failed: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cookies.MakeCookieFromOptions(
|
return cookies.MakeCookieFromOptions(
|
||||||
req,
|
req,
|
||||||
t.options.Name,
|
t.options.Name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue