Wappler Version : all versions
Operating System : Windows 10
Server Model: NodeJS
Database Type: MariaDB
Hosting Type: Custom
Expected behavior
When no user has logged in or a logged in user has been logged out, I expect to see
Actual behavior
When a logged in user is logged out, I see
and
This is probably another of my senior moments. In the past, I have kept track of logged in/out users using a session variable. But surely I should be able to use identity to perform the task.
I should add that I am not sending the user to a login page or similar. The user stays on the same page. However, when I refresh the page after logout, all is well.
I don’t see why the page should be refreshed or go to another page for the identity to function properly.
Hi Ben,
The steps added in the Globals are executed before the server actions steps.
In your case, the Identity value is displayed, then the logout action runs. That’s why you still the identity, on page refresh it will clear as the user already logged out.
You can add the identity step in the logout server action also, just after the logout step, this should clear the identity.
I see that you have dmx-on:click="scLogout.load(true);scCustomerDetail.load()"> - that’s not how it should be done.
You should not load the customer details server action there. It should only be loaded on success of logout action.
And also the logout action properly shows empty identity:
You don’t need a form
Run the logout server action on click. Then for the logout server action add dynamic event > success > and run the user details server action there.