Page 1 of 2
Reset Login info on Logout
Posted: Thu Jul 10, 2014 2:58 pm
by Marco Spera
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?
Reset Login info on Logout
Posted: Thu Jul 10, 2014 4:16 pm
by Evgene Karachevtsev
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
Reset Login info on Logout
Posted: Thu Jul 10, 2014 4:18 pm
by Marco Spera
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?
Reset Login info on Logout
Posted: Thu Jul 10, 2014 9:07 pm
by Evgene Karachevtsev
Marco,
You should try this on Page show event page on which you can see these inputs
Reset Login info on Logout
Posted: Thu Jul 10, 2014 9:11 pm
by Marco Spera
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/...
Reset Login info on Logout
Posted: Fri Jul 11, 2014 1:40 am
by Yurii Orishchuk
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.
Reset Login info on Logout
Posted: Fri Jul 11, 2014 1:44 am
by Marco Spera
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?
Reset Login info on Logout
Posted: Fri Jul 11, 2014 1:49 am
by Marco Spera
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!
Reset Login info on Logout
Posted: Fri Jul 11, 2014 2:49 am
by Yurii Orishchuk
Marco,
Please follow this solution:
Open your page with logout service.
On "success" event where you navigate to home page, click "edit"
Check "Use full screen refresh" checkbox.
see details: http://prntscr.com/41h7ir/direct
That's all.
Regards.
Reset Login info on Logout
Posted: Fri Jul 11, 2014 3:46 am
by Marco Spera
Works great!!
Thanks Yurii