-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix remote possibility to return wrong current order
Orders' guest token is always populated thanks to a [`before_create` callback on the application layer](https://github.com/solidusio/solidus/blob/ea200dfcc03ed542ab130317ccab4f365c31af7e/core/app/models/spree/order.rb#L128). However, it can be `NULL` in the database. This commit makes sure that no order is returned in two situations: 1. `X-Spree-Order-Token` is not given, and it exists an order with `NULL` guest token. 2. `X-Spree-Order-Token` is provided as an empty string, and it exists an order with an empty string as a guest token. Being defensive against these two options leaves us on the safe side if business rules around the guest token change at some point in solidus-core. This problem is similar to what is fixed in #182
- Loading branch information
1 parent
a8bb333
commit e411188
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters