refactor: use the same promise syntax as angular.js in the auth service