Can not logout

Try this:

<li dmx-hide="!getuserdata.data.query2.accountname" dmx-on:click="userlogout.load()"><i class="fas fa-sign-out-alt"></i> Sign Out</li>

And if you want to use the pointer as mentioned in my previous post then it would be like this:

<li class="hover-hand" dmx-hide="!getuserdata.data.query2.accountname" dmx-on:click="userlogout.load()"><i class="fas fa-sign-out-alt"></i> Sign Out</li>

thanks, I tried your code though, still not working. 200 is responding but not goes through onsuccess event.

I don’t think the <a> tag is related to the error.
What steps exactly do you have in the server action?

My suggestion wasn’t to fix your logout issue, it was just to highlight you don’t need the <a> tag.

As I showed above,

  1. Click “SIGN OUT” -> Load Serverconnect
  2. Server Connect (Security provider -> Security Logout)
  3. Serverconnect on Success -> Browser alert -> Browser goto

Am I wrong?


Remove the security provider step from your server action… only use the global one

I removed Security provider, but still not working.

Is the security logout step pointing to your global security provider?
And also make sure the login server action also points to the global one and not using security provider as a step!

When you change that clear your cookies and log in and out again.

I cleared cookies but still not working. (I can login but I can not logout)

Regarding the global security provider, I set one in Global settings like this.

And I’m using this “security1” in server action steps of login and logout both.
Is it wrong?

Remove the security provider from the steps in your both server actions. You only need the login step and the logout step. The security provide you already have defined in globals, so you should be using it.

oh no, I’ve been wrong for a while…thank you so much.

So did you manage to fix the issue?

now I removed it from server action steps, but still not working.

I could log in before removing it, now I can not…

Make sure to define the security provider under globals and then save it. Then re-select in the login and logout step. Save the server actions again.

I did what you mentioned.

now I see this error, when I try to login.

code: 0
file: "/var/www/html/dmxConnectLib/modules/auth.php"
line: 44
message: "Call to a member function login() on null"
trace: "#0 /var/www/html/dmxConnectLib/lib/App.php(173): modules\auth->login(Object(stdClass), 'identity')↵#1 /var/www/html/dmxConnectLib/lib/App.php(137): lib\App->execSteps(Object(stdClass))↵#2 /var/www/html/dmxConnectLib/lib/App.php(107): lib\App->execSteps(Array)↵#3 /var/www/html/dmxConnectLib/modules/core.php(90): lib\App->exec(Object(stdClass), true)↵#4 /var/www/html/dmxConnectLib/lib/App.php(173): modules\core->condition(Object(stdClass), '')↵#5 /var/www/html/dmxConnectLib/lib/App.php(137): lib\App->execSteps(Object(stdClass))↵#6 /var/www/html/dmxConnectLib/lib/App.php(107): lib\App->execSteps(Array)↵#7 /var/www/html/dmxConnectLib/lib/App.php(72): lib\App->exec(Object(stdClass))↵#8 /var/www/html/dmxConnect/api/Security/signin.php(8): lib\App->define(Object(stdClass))↵#9 {main}"

Remove the dmxConnectLib folder locally and resave your server action. Then upload the newly generated dmxConnectLib folder to your server and test again.

I could singup & autologin and logout after doing what you mentioned in your previous reply.
But I could not re-login with the same combination of email and password.
Now server action steps of login maybe wrong.

Thanks a lot for taking your time, now it works!!

1 Like

Hi,

I’m having a similar issue with the user logout action. The action runs correctly when logout button is clicked but the user is not logged out. If I click the logout button again, the logout action runs successfully and user is logged out. I have attached a screenshot showing two logout actions, the first logout click action has executed without success and the second logout click action has executed successfully.

I have tried deleting and recreating the server action but it hasn’t resolved the issue. The server connect code is:

<dmx-serverconnect id="sc_user_logout" url="/dmxConnect/api/BE_Actions/Usr_Act/user_logout.aspx" noload dmx-on:success="browser1.goto('../index.html')"></dmx-serverconnect>

Screen Shot 2021-02-16 at 1.04.52 pm

Any assistance in resolving the issue is greatly appreciated. Thank you.