Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('ocrewingApiApp')
- .factory('auth_provider', [
- '$auth',
- function ($auth) {
- var o = {
- user: {},
- config: {}
- };
- o.login = function(auth, config) {
- angular.copy(config, o.config);
- return $auth.submitLogin(auth, config);
- };
- o.register = function(auth, config) {
- angular.copy(config, o.config);
- return $auth.submitRegistration(auth, config);
- };
- o.signOut = function() {
- return $auth.signOut();
- };
- o.validateUser = function(config) {
- angular.copy(config, o.config);
- console.log(o.config);
- return $auth.validateUser(o.config).then(function(resp){
- angular.copy(resp, o.user);
- });
- };
- o.requestPasswordReset = function(data) {
- return $auth.requestPasswordReset(data);
- };
- o.updatePassword = function(data) {
- return $auth.updatePassword(data);
- };
- o.updateAccount = function(data, config){
- return $auth.updateAccount(data, config);
- };
- return o;
- }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement