Class: Dashboard::V2::MainController

Inherits:
ApplicationController show all
Includes:
LogrageCustomLogger, OwnerDashboardsHelper, OwnerLoginMode, Pagy::Backend, Pundit::Authorization, Stimulus::TagController
Defined in:
app/controllers/dashboard/v2/main_controller.rb

Overview

Base Controller for Dashboard::V2 controllers

Defined Under Namespace

Classes: ReservationNotAuthorizedError

Instance Method Summary collapse

Methods included from LogrageCustomLogger

#append_info_to_payload

Methods included from Stimulus::TagController

#stimulus

Methods included from OwnerLoginMode

#current_owner, #group_owner_type?, #request_path_contain_group?, #single_owner_type?

Methods included from OwnerDashboardsHelper

#events_ajax_previous_link, #show_source

Methods inherited from ApplicationController

#after_sign_in_path_for, #after_sign_out_path_for, #identity_cache_memoization, #render_not_found, #routing_error, search_params_key=

Methods included from ControllerHelpers

#check_boolean_param, #get_banners, #inventory_params, #reservation_params

Instance Method Details

#default_fallback_locationObject



62
63
64
# File 'app/controllers/dashboard/v2/main_controller.rb', line 62

def default_fallback_location
  dashboard_v2_reservations_path(locale: I18n.locale)
end

#default_url_optionsObject



58
59
60
# File 'app/controllers/dashboard/v2/main_controller.rb', line 58

def default_url_options
  { locale: I18n.locale }
end

#kiosque_callbackObject

for testing purpose



45
46
47
48
49
50
51
52
53
54
55
# File 'app/controllers/dashboard/v2/main_controller.rb', line 45

def kiosque_callback
  application = Doorkeeper::Application.find_by(name: 'Kiosque')
  if application
    uri = application.redirect_uri.split.last
    oauth_authorization_path(client_id: application.uid, redirect_uri: uri, response_type: 'code',
                             scope: application.scopes)
  else
    redirect_back fallback_location: dashboard_v2_reservations_path(locale: I18n.locale),
                  alert: 'We are sorry, something went wrong'
  end
end