phpsword / sword-bundle

Modern WordPress development with Symfony
https://getsword.com
MIT License
124 stars 4 forks source link

replace authentication exceptions with session storage #43

Open aroberts91 opened 4 months ago

aroberts91 commented 4 months ago

This PR attempts to replace the Login/Logout exceptions thrown when the wp_login/wp_logout actions are called with session based logic.

As explained in the linked issue, these exceptions can cause other plugins which rely on wp_login to fail or behave unexpectedly when the exceptions are thrown.

Instead of throwing the exceptions I've attempted storing the required data in session and looking for it within createWordpressResponse.

Resolves #42

williarin commented 4 months ago

Thank you for your contribution! I need to try it with a project that uses Symfony auth as well, I'll let you know if it works.

aroberts91 commented 2 months ago

Hi @williarin, were you able to test this?

williarin commented 2 months ago

Really sorry I haven't had the time yet! I will do my best to try it in the following days. On your side have you found any problem to keep Symfony session in sync with this solution or does it work as expected?