Files
fizzy/app/controllers/sessions/menus_controller.rb
T
Mike Dalessio 89d1299ec0 Fix authentication on "untenanted" controllers
trying out the name "disallow_account_scope" for this, but I don't
think it's quite right yet.
2025-11-17 09:11:47 -05:00

25 lines
570 B
Ruby

class Sessions::MenusController < ApplicationController
disallow_account_scope
before_action(if: :render_as_menu_section?) { request.variant = :menu_section }
layout "public"
def show
@memberships = Current.identity.memberships
if params[:without]
@memberships = @memberships.where.not(tenant: params[:without])
end
if @memberships.one? && !render_as_menu_section?
redirect_to root_url(script_name: "/#{@memberships.first.tenant}")
end
end
private
def render_as_menu_section?
params[:menu_section]
end
end