feat(session/reader): return session on validation error

This commit is contained in:
Trong Huu Nguyen
2023-06-09 12:17:16 +02:00
parent cbfa3fe2e2
commit 2a8d410425

View File

@@ -69,10 +69,12 @@ func (in *reader) getForTicket(ctx context.Context, ticket *Ticket) (*Session, e
return nil, fmt.Errorf("%w: decrypting session data: %w", ErrInvalid, err)
}
sess := NewSession(data, ticket)
err = data.Validate()
if err != nil {
return nil, err
return sess, err
}
return NewSession(data, ticket), nil
return sess, nil
}