Files
openfoodnetwork/app/assets/javascripts/darkswarm/controllers/authentication/signup_controller.js.coffee

15 lines
588 B
CoffeeScript

Darkswarm.controller "SignupCtrl", ($scope, $http, $window, $location, Redirections, AuthenticationService) ->
$scope.path = "/signup"
$scope.errors =
email: null
password: null
$scope.submit = ->
$http.post("/user/spree_user", {spree_user: $scope.spree_user}).success (data)->
if Redirections.after_login
$window.location.href = $window.location.origin + Redirections.after_login
else
$window.location.href = $window.location.origin + $window.location.pathname # Strips out hash fragments
.error (data) ->
$scope.errors = data