mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Update :return_url value when re-sending email confirmations
This commit is contained in:
committed by
Rob Harrington
parent
1f23402912
commit
1c57f0f241
@@ -13,7 +13,7 @@ Darkswarm.controller "ForgotCtrl", ($scope, $http, $location, AuthenticationServ
|
||||
$scope.errors = t 'email_required'
|
||||
|
||||
$scope.resend_confirmation = ->
|
||||
$http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user}).success (data)->
|
||||
$http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).success (data)->
|
||||
$scope.messages = t('devise.confirmations.send_instructions')
|
||||
.error (data) ->
|
||||
$scope.errors = t('devise.confirmations.failed_to_send')
|
||||
|
||||
@@ -14,7 +14,7 @@ Darkswarm.controller "LoginCtrl", ($scope, $timeout, $location, $http, $window,
|
||||
$scope.user_unconfirmed = (data.error == t('devise.failure.unconfirmed'))
|
||||
|
||||
$scope.resend_confirmation = ->
|
||||
$http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user}).success (data)->
|
||||
$http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).success (data)->
|
||||
$scope.messages = t('devise.confirmations.send_instructions')
|
||||
.error (data) ->
|
||||
$scope.errors = t('devise.confirmations.failed_to_send')
|
||||
|
||||
@@ -8,6 +8,7 @@ class UserConfirmationsController < DeviseController
|
||||
|
||||
# POST /resource/confirmation
|
||||
def create
|
||||
set_return_url if params.key? :return_url
|
||||
self.resource = resource_class.send_confirmation_instructions(resource_params)
|
||||
|
||||
if is_navigational_format?
|
||||
@@ -30,6 +31,10 @@ class UserConfirmationsController < DeviseController
|
||||
|
||||
protected
|
||||
|
||||
def set_return_url
|
||||
session[:confirmation_return_url] = params[:return_url]
|
||||
end
|
||||
|
||||
def after_confirmation_path_for(resource)
|
||||
result =
|
||||
if resource.errors.empty?
|
||||
|
||||
Reference in New Issue
Block a user