mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
15 lines
588 B
CoffeeScript
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
|