Don't override devise's after_sign_in_path_for, use specific before filters for user sessions and registrations controllers instead

This commit is contained in:
Rob Harrington
2015-04-16 16:56:27 +10:00
parent 0c155e6e3a
commit 5940ff2b2c
5 changed files with 61 additions and 14 deletions

View File

@@ -8,15 +8,12 @@ class ApplicationController < ActionController::Base
super(options, response_status)
end
def after_sign_in_path_for(resource)
def set_checkout_redirect
if request.referer and referer_path = URI(request.referer).path
[main_app.checkout_path].include?(referer_path) ? referer_path : root_path
else
root_path
session["spree_user_return_to"] = [main_app.checkout_path].include?(referer_path) ? referer_path : root_path
end
end
private
def require_distributor_chosen