(self, user, password, token=None, callback=None)
Login with a username and password

        Arguments:
        user - username or email address
        password - the password for the account

        Keyword Arguments:
        token - meteor resume token
        callback - callback function containing error as first argument and login data
Login with a username and password
Login with a username and password
def login(self, user, password, token=None, callback=None):
        """Login with a username and password

        Arguments:
        user - username or email address
        password - the password for the account

        Keyword Arguments:
        token - meteor resume token
        callback - callback function containing error as first argument and login data"""
        # TODO: keep the tokenExpires around so we know the next time
        #       we need to authenticate

        # hash the password
        hashed = hashlib.sha256(password).hexdigest()
        # handle username or email address
        if '@' in user:
            user_object = {
                'email': user
            }
        else:
            user_object = {
                'username': user
            }
        password_object = {
            'algorithm': 'sha-256',
            'digest': hashed
        }

        self._login_token = token
        self._login_data = {'user': user_object, 'password': password_object}

        if token:
            self._resume(token, callback=callback)
        else:
            self._login(self._login_data, callback=callback)
def login ( self , user , password , token = None , callback = None ) : # TODO: keep the tokenExpires around so we know the next time #       we need to authenticate # hash the password hashed = hashlib . sha256 ( password ) . hexdigest ( ) # handle username or email address if '@' in user : user_object = { 'email' : user } else : user_object = { 'username' : user } password_object = { 'algorithm' : 'sha-256' , 'digest' : hashed } self . _login_token = token self . _login_data = { 'user' : user_object , 'password' : password_object } if token : self . _resume ( token , callback = callback ) else : self . _login ( self . _login_data , callback = callback )