refactored login to return a promise so I could re-use it to validate login on list page