Starting a working forgot password system

This commit is contained in:
Will Marshall
2014-03-27 15:11:11 +11:00
parent adcd5e1c8d
commit e48a25983a
6 changed files with 61 additions and 4 deletions

View File

@@ -1,6 +1,21 @@
window.ForgotSidebarCtrl = Darkswarm.controller "ForgotSidebarCtrl", ($scope, $http, $location) ->
$scope.spree_user = {
email: null
}
$scope.active = ->
$location.path() == '/forgot'
$scope.select = ->
$location.path("/forgot")
$scope.submit = ->
if $scope.spree_user.email != null
$http.post("/user/spree_user/password", {spree_user: $scope.spree_user}).success (data)->
$location.path("/reset")
.error (data) ->
$scope.errors = "Email address not found"
else
$scope.errors = "You must provide an email address"