Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Reset Login info on Logout

Hi,

I am having trouble resetting the login and password fields when the user clicks the logout button.

I am assuming this following code should work:

Appery("loginpage").find("input[type=text]").val("");
Appery("loginpage").find("input[type=password]").val("");

I have tried setting in on successful logout as well as on login page load.
Neither seem to work.

Any ideas what may be causing the issue?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Reset Login info on Logout

Hello Marco,

codeAppery("loginpage").find("input[type=text]")/code

is not the correct code.
If you want to reset the text of input, you should do like this:

codeAppery("inputComponentName").val("");/code

where inputComponentName is the name of component input

Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Reset Login info on Logout

I tried this as well, with no luck.

Should I be running the js on page load of the login page, or success of the logout service.....or does it matter?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Reset Login info on Logout

Marco,

You should try this on Page show event page on which you can see these inputs

Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Reset Login info on Logout

Hi Evgene,

That is where I as trying it, but it does not seem to be working.

When I navigate back to the login page (upon clicking the logout button) I still receive the username and password that i previously entered, sitting in the inputs.

Does it make a difference that the username and password are saved into the local storage. I setup my login page following the tutorial here:
http://devcenter.appery.io/tutorials/...

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Reset Login info on Logout

Hi Marco,

If you have some LSV with userName and password you should clear them on "success" logout event with following code:

pre

//Note you should replace "password" and "userName" with your LSVs.
localStorage.removeItem("password");
localStorage.removeItem("userName");

/pre

Also, if you still have this problem please give us your app public link and describe steps to reproduce your problem.

Regards.

Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Reset Login info on Logout

Hi Yurii,

Do i just use the code you suggested to remove the LSV or also add the code Evgene mentioned reset the text input?

Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Reset Login info on Logout

Seems to not help fix the problem.

The link to the public app is:
http://appery.io/app/mobile-frame?src...

you can login with the username "a" and the password "a", then try and hit the logout button to see if the username and password reset to blank.

Thanks!

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Reset Login info on Logout

Marco,

Please follow this solution:

  1. Open your page with logout service.

  2. On "success" event where you navigate to home page, click "edit"

  3. Check "Use full screen refresh" checkbox.

    see details: http://prntscr.com/41h7ir/direct

    That's all.

    Regards.

Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Reset Login info on Logout

Works great!!

Thanks Yurii

Return to “Issues”