-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
return Challenge() in [HttpPost] methods #400
Comments
@TheFlo Thanks, it looks is a bug, we will fix it asap. |
Please check it #401 |
Many thanks @KrzysztofPajak for your fast answer, the fix works like a charm 👍 In order to cover the case when no term of service is activated in the cart, I've extended and refactored the fix using the following code: In
In
(I'm sorry that I'm not able to propose a PR for this at this moment...) Would it be a good addition to your fix ? |
@TheFlo Thanks, you have absolutely right, I've committed changes |
Hi GrandNode team,
Following addition of [HttpGet] and [HttpPost] attributes on controller methods in commit 791cf2b, there seems to be a breaking change on method StartCheckout in ShoppingCartController.cs with
[HttpPost]
attribute :If the customer is not connected and anonymous checkout is not allowed, method will return
Challenge()
, resulting in a redirection tologin?ReturnUrl=/cart/checkout
url.Once logged, the user will be redirected (using HttpGet) to /cart/checkout, which routes back to the
ShoppingCartController.StartCheckout
method but, as this method is flagged with[HttpPost]
, the customer is redirected to the 404page-not-found
page.Adding a [HttpGet] method with the same ActionName seems to solve the issue:
Do you see a better solution in order to fix this issue ?
There are other methods with a
[HttpPost]
attribute usingreturn Challenge()
which might needs futher investigation.Kind regards
The text was updated successfully, but these errors were encountered: