Results 1 to 5 of 5

Thread: Login/Logout system: How to remember username & password

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    12
    Vote Rating
    0
      0  

    Default Unanswered: Login/Logout system: How to remember username & password

    Hi everyone,

    Wich is the best way to remember the username and password in a login/logout system if there is no class for cookies implemented? How could I do that? Im looking for any example of login/logout system that allows the users to skip the login screen if they've been logged previously.

    Any idea or code example?

    I'd appreciate any help.Thanks in advance.

  2. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    I think localStorage or caching with a manifest is what you need.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    12
    Vote Rating
    0
      0  

    Default

    Thanks for you reply.

    I've never heard about phantomjs before so I'll take a look at that because I dont know how it works.

    I've tried to do it using localstorage but in my particular case I load the response that I get from the server into a store on this way:


    Code:
    loginStore.load({
                
                 
                params:{
                    
                    login: form['login'],
                    clave: form['clave']
                    
                },
                scope: this,
               
                
                callback : function(records, operation, success) {
                  
                    console.log('LoginController:Login:callback');
                    console.log('JSON returned');
                  
                    console.log(arguments);
                  
                    Ext.Viewport.setMasked({
                        xtype: 'loadmask', 
                        message: 'Cargando...'
                    });
                   
                    
                    
                    if (success==true) { 
                        console.log('LoginController:Login:callback:Login Ok');
                       
    
    //Here is where I'd like to use the localstorage in order to remember the user and password but it //doesn't work inside the callback function of another store. 
    
    
    
                        //Load a new view
                        Ext.Viewport.setActiveItem({
                            xtype: 'menuview'
                        });
                    
                    }
                    
                       else { 
                        console.log('LoginController:Login:callback:Login failed');
                        //Quitar el loadmask
                        Ext.Viewport.setMasked(false);
                        Ext.Msg.alert('Error de login', 'El nombre de usuario o la contrasea son incorrectos');
                       
                    }
                        
          
                }
                
       });
            
            
            
           
       
           
            
       
      
        
          
                       
        
        
             
    
    
        }

  4. #4
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    46
    Answers
    1
    Vote Rating
    3
      1  

    Default

    I am integrating my app with Parse.com, it has built-in functionality for Users. Cached user is one of them.

  5. #5
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    Quote Originally Posted by kbow View Post
    I am integrating my app with Parse.com, it has built-in functionality for Users. Cached user is one of them.
    Thanks kbow for that. That looks pretty easy

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •