fix: error wrapping

Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
Jan Larwig 2025-10-28 08:29:31 +01:00
parent 9d36542183
commit 293521a01c
No known key found for this signature in database
GPG Key ID: C2172BFA220A037A
1 changed files with 4 additions and 2 deletions

View File

@ -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,