Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

"Remember Me" feature at Login using local storage

$
0
0

@RamithDR wrote:

Hi!

I need to add a remember me feature to the app I'm developing, I've added a check-box inside the login form and used jquery to store the email and password when the remember-me check box is ticked, it works well on a normal html project but not in my ionic app (I built the apk and tested too).

My jquery code :

$(function() { if (localStorage.chkbx && localStorage.chkbx != '') { $('#remember_me').attr('checked', 'checked'); $('#email').val(localStorage.email); $('#pass').val(localStorage.pass); } else { $('#remember_me').removeAttr('checked'); $('#email').val(''); $('#pass').val(''); } $('#remember_me').click(function() { if ($('#remember_me').is(':checked')) { // save username and password localStorage.email = $('#email').val(); localStorage.pass = $('#pass').val(); localStorage.chkbx = $('#remember_me').val(); } else { localStorage.email = ''; localStorage.pass = ''; localStorage.chkbx = ''; } }); });

I'm using an ionic starter from the market as the user/login :

http://market.ionic.io/starters/firebaseauthstarter

How can I get this feature to work?

I'm new to ionic and Angular, I'm trying to learn while developing, so please bear with me :smiley:

P.S. Security isn't an issue since the app is very simple and does not contain any sensitive data, therefore encrypting data stored in local storage is not needed, I just need a simple way to implement the remember me feature so that users doesn't require to login everytime they open the app.

Thanks in advance!

Posts: 5

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>