Class: DuodealerApp::SessionsController

Inherits:
ApplicationController
  • Object
show all
Includes:
LoginProtection
Defined in:
app/controllers/duodealer_app/sessions_controller.rb

Overview

rubocop:disable Metrics/ClassLength

Instance Method Summary collapse

Methods included from LoginProtection

#account_session, #duodealer_session, #login_again_if_different_user_or_account

Instance Method Details

#createObject



16
17
18
# File 'app/controllers/duodealer_app/sessions_controller.rb', line 16

def create
  authenticate
end

#destroyObject



52
53
54
55
56
# File 'app/controllers/duodealer_app/sessions_controller.rb', line 52

def destroy
  reset_session
  flash[:notice] = I18n.t(".logged_out")
  redirect_to()
end

#enable_cookiesObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/controllers/duodealer_app/sessions_controller.rb', line 20

def enable_cookies
  return unless 

  render(:enable_cookies, layout: false, locals: {
    does_not_have_storage_access_url: top_level_interaction_path(
      account: ,
      return_to: params[:return_to]
    ),
    has_storage_access_url: (top_level: true),
    app_target_url: granted_storage_access_path(
      account: ,
      return_to: params[:return_to]
    ),
    current_duodealer_domain: current_duodealer_domain
  })
end

#granted_storage_accessObject



42
43
44
45
46
47
48
49
50
# File 'app/controllers/duodealer_app/sessions_controller.rb', line 42

def granted_storage_access
  return unless 

  session["duodealer.granted_storage_access"] = true

  copy_return_to_param_to_session

  redirect_to(return_address_with_params({ account: @account }))
end

#newObject



12
13
14
# File 'app/controllers/duodealer_app/sessions_controller.rb', line 12

def new
  authenticate if .present?
end

#top_level_interactionObject



37
38
39
40
# File 'app/controllers/duodealer_app/sessions_controller.rb', line 37

def top_level_interaction
  @url = (top_level: true)
  
end