refactor(session): wrap error for decrypt

This commit is contained in:
Trong Huu Nguyen
2023-02-23 14:29:49 +01:00
parent b248dd8875
commit 08c6e96670
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
package middleware
+1 -1
View File
@@ -66,7 +66,7 @@ func (in *reader) getForTicket(ctx context.Context, ticket *Ticket) (*Session, e
data, err := encrypted.Decrypt(ticket.Crypter())
if err != nil {
return nil, fmt.Errorf("decrypting session data: %w", err)
return nil, fmt.Errorf("%w: decrypting session data: %w", ErrInvalid, err)
}
err = data.Validate()