crimata-website/app/controllers/application_controller.rb
Andrew Gundersen 008524db1b Remove dashboard, route post-checkout to home
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 21:57:07 -05:00

21 lines
443 B
Ruby

class ApplicationController < ActionController::Base
helper_method :current_customer
private
def current_customer
@current_customer ||= Customer.find_by(id: session[:customer_id])
end
def require_auth
unless current_customer
session[:return_to] = request.fullpath
redirect_to login_path
end
end
def redirect_after_auth
path = session.delete(:return_to) || root_path
redirect_to path
end
end