Last active
          December 19, 2015 03:39 
        
      - 
      
- 
        Save brodkin/5891699 to your computer and use it in GitHub Desktop. 
    Magento Force Customer Login With Password
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Mage::app("default"); | |
| // Set the variables that we care about. | |
| $storeId = 1; | |
| $username = '[email protected]'; | |
| $password = 'theirpassword'; | |
| try{ | |
| $authenticated = Mage::getModel('customer/customer') | |
| ->setWebsiteId($storeId) | |
| ->authenticate($username, $password); | |
| } catch ( Exception $e ) { | |
| $authenticated = false; | |
| } | |
| // Do something depending on whether $authenticated is truthy | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment