I have a form on the login page with username and password text fields. Now wen the user registers for an account, I want to add him to the User model. And when he logs in I need to check whether the username/password combination is accurate to allow entry into the Sencha app.
I have no idea how to go about verifying the login/pass combo. Someone help !!! Here's my code.
The Model :
App.models.Users = Ext.regModel('Expense',{
fields : [
{ name : 'id', type : 'integer'},
{ name : 'email', type : 'string'},
{ name : 'pass', type : 'string'}
],
validations : [
{ name : 'email', type : 'presence', message : 'cannot leave field blank'},
{ name : 'pass', type : 'presence', message : 'cannot leave field blank'}
],
proxy : {
type : 'localstorage',
id : 'user-creds'
}
});
Store :
App.stores.User = new Ext.data.Store ({
model : 'Users',
autoLoad : true,
autoSave : true
});
The Form is a basic one, with an xtype "textfield" for email, and "passwordfield" for password.
How do I verify that the details entered in the form match those stored in the localstorage???