Get Referer after login
Hello,
Currently on our app, we are redirected on a defined page (for the example let's say /landing-page ) after login, whatever the link (for example /whatever-category/random-product ) which brought us on the website.
So if someone wants to share a link "www.mywonderfulplatform.com/whatever-category/random-product".
I click on the link, I have to login, and after that I'm on "www.mywonderfulplatform.com/landing-page".
I've tried to setup a plugin, added to CustomerPageDependencyProvider::getAfterLoginCustomerRedirectPlugins(), but this need to have a CustomerTransfer parameter, what I can't have as I'm not logged in yet.
I've tried to setup an event listener and play with the session, but nobody talks to my listener (I've added it to KernelEvents::REQUEST, but it's never called).
If any of you already did smthg like this, it could be very helpful to share how you did that :)
Thank you in advance !
Answers
-
You could add some logic in your AuthController to catch referer Url and do the trick by extending the
SprykerRedirectUriCustomerRedirectStrategyPlugin
1 -
Hello, thank you for that, but in fact I found what was wrong: my SecurityTwigPlugin prevented me to get the referer (it was edited some time ago in the project).
1
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 69 Spryker News
- 899 Developer Corner
- 760 Spryker Development
- 83 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 24 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random