refactored objectToArray to be included in auth.factories.js