diff --git a/app/partials/forgetPassword/forgetPassword.service.js b/app/partials/forgetPassword/forgetPassword.service.js new file mode 100644 index 0000000..c39bf0d --- /dev/null +++ b/app/partials/forgetPassword/forgetPassword.service.js @@ -0,0 +1,27 @@ +(function(){ + 'use strict'; + angular.module('acufuel') + .service('forgetPasswordService', ['$q', '$http', 'BASE_URL', forgetPasswordService]); + + function forgetPasswordService($q, $http, BASE_URL) { + + this.recoverpassword = function(email) { + var param = 'email='+ email; + var deferred = $q.defer(); + $http({ + method : 'PUT', + url : BASE_URL.url +'/user/recoverpassword', + headers : {'Content-Type': 'application/x-www-form-urlencoded'}, + data: param + }) + .then(function (result){ + deferred.resolve(result.data); + },function (result){ + deferred.resolve(result.data); + }) + return deferred.promise; + } + + } + +})(); \ No newline at end of file diff --git a/app/partials/resetpwd/resetPassword.controller.js b/app/partials/resetpwd/resetPassword.controller.js new file mode 100644 index 0000000..8c57ef4 --- /dev/null +++ b/app/partials/resetpwd/resetPassword.controller.js @@ -0,0 +1,16 @@ +(function() { + 'use strict' + + angular.module('acufuel') + .controller('resetPasswordController', [ '$scope', '$filter', '$rootScope', 'ResetPasswordService', '$state','LoginService', resetPasswordController]); + + function resetPasswordController($scope, $filter, $rootScope, ResetPasswordService, $state,LoginService) { + $scope.submitLogin = function() { + ResetPasswordService.changepassword($scope.password, $scope.confirmPassword).then(function(result){ + toastr.info("Password updated successfully"); + localStorage.removeItem("requiredChangePwd"); + LoginService.authenticate(); + }) + } + } +})(); \ No newline at end of file diff --git a/app/partials/resetpwd/resetPassword.html b/app/partials/resetpwd/resetPassword.html new file mode 100644 index 0000000..1630b58 --- /dev/null +++ b/app/partials/resetpwd/resetPassword.html @@ -0,0 +1,65 @@ + +
+
+ + +
+
+
+
+ + + + + + + + + diff --git a/app/partials/resetpwd/resetPassword.service.js b/app/partials/resetpwd/resetPassword.service.js new file mode 100644 index 0000000..ef3f810 --- /dev/null +++ b/app/partials/resetpwd/resetPassword.service.js @@ -0,0 +1,26 @@ +(function(){ + 'use strict'; + angular.module('acufuel') + .service('ResetPasswordService', ['$q', '$http', 'BASE_URL', ResetPasswordService]); + + function ResetPasswordService($q, $http, BASE_URL) { + var temp = {}; + + this.changepassword = function(password, confirmpassword) { + var deferred = $q.defer(); + var param = 'password='+ password + '&confirmpassword=' +confirmpassword; + $http({ + method : 'PUT', + url : BASE_URL.url+'/user/changepassword', + headers : {'Content-Type': 'application/x-www-form-urlencoded'}, + data: param + }).then(function (result){ + deferred.resolve(result.data); + },function (result){ + deferred.resolve(result.data); + }); + return deferred.promise; + } + } + +})(); \ No newline at end of file