Method: PandaPal::Helpers::ControllerHelper#valid_session?

Defined in:
lib/panda_pal/helpers/controller_helper.rb

#valid_session?Boolean

Returns:

  • (Boolean)


129
130
131
132
133
134
135
136
137
# File 'lib/panda_pal/helpers/controller_helper.rb', line 129

def valid_session?
  return false unless current_panda_session&.persisted?
  return false unless current_organization
  return false unless current_panda_session.panda_pal_organization_id == current_organization.id
  return false unless Apartment::Tenant.current == current_organization.tenant_name
  true
rescue SessionNonceMismatch
  false
end