diff --git a/app/assets/javascripts/darkswarm/controllers/authentication/signup_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/authentication/signup_controller.js.coffee index 7ba6477d5e..7de1016e06 100644 --- a/app/assets/javascripts/darkswarm/controllers/authentication/signup_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/authentication/signup_controller.js.coffee @@ -9,9 +9,6 @@ Darkswarm.controller "SignupCtrl", ($scope, $http, $window, $location, Redirecti $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 + $scope.messages = t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') .error (data) -> $scope.errors = data diff --git a/app/assets/javascripts/templates/signup.html.haml b/app/assets/javascripts/templates/signup.html.haml index 23eab8e38c..f2d480c8b9 100644 --- a/app/assets/javascripts/templates/signup.html.haml +++ b/app/assets/javascripts/templates/signup.html.haml @@ -1,5 +1,9 @@ %tab#sign-up-content{ heading: "{{'label_signup' | t}}", active: 'tabs.signup.active', select: "select(path)"} %form{ ng: { controller: "SignupCtrl", submit: "submit()" } } + .row + .large-12.columns + .alert-box.success{ng: {show: 'messages != null'}} + {{ messages }} .row .large-12.columns %label{for: "email"} {{'signup_email' | t}} diff --git a/app/controllers/user_registrations_controller.rb b/app/controllers/user_registrations_controller.rb index b4e9c3a7cc..da89582fc7 100644 --- a/app/controllers/user_registrations_controller.rb +++ b/app/controllers/user_registrations_controller.rb @@ -5,12 +5,12 @@ class UserRegistrationsController < Spree::UserRegistrationsController def create @user = build_resource(params[:spree_user]) if resource.save - set_flash_message(:success, :signed_up_but_unconfirmed) session[:spree_user_signup] = true associate_user respond_to do |format| format.html do + set_flash_message(:success, :signed_up_but_unconfirmed) redirect_to after_sign_in_path_for(@user) end format.js do