News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

hook order integrate_verify_user / integrate_logout

Started by danielrichter, January 30, 2023, 03:46:37 PM

Previous topic - Next topic

danielrichter

Is it possible to run the integrate_logout hook even when the integrate_verify_user hook is active?

I've registered both hooks and placed a simple

die("login");
die("logut");

into each hook (head).

The integrate_verify_user hook is triggered even if I click hit the logout route.
integrate_verify_user is used to read user id from an external application and perform login, but for sure, this won't make sense on logout route.

My idea was to implement a logout functionality into both apps (SMF and the external application).
-Is this possible or is it required to perform "logout" logic on only one side of the applications?

Both hooks are registered and active (checked from ACP).

Arantor

I think you misunderstand; the logout hook isn't 'log me out from an external source', it's 'when the user logs out, notify an external source'. It's driven from SMF receiving the logout action - which also requires the user to be logged in first to be able to log them out. So by definition it *can only* run when integrate_verify_user is active.

Every page load, the user will be validated if they are logged in to your other app - so you only need to make sure that if they hit logout in SMF, your other app is notified and that they are logged out there too.
Holder of controversial views, all of which my own.

Advertisement: