Class: ShopQiApp::SessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/shopqi_app/sessions_controller.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#authenticate_shop!, #current_shop, #shop_url, #signed_in?

Instance Method Details

#destroyObject



19
20
21
22
# File 'app/controllers/shopqi_app/sessions_controller.rb', line 19

def destroy
  cookies.delete(:shop_id)
  redirect_to main_app.root_path
end

#newObject



5
6
7
8
9
# File 'app/controllers/shopqi_app/sessions_controller.rb', line 5

def new
  if params[:shop].present?
    redirect_to "/auth/shopqi?shop=#{params[:shop].to_s.strip}"
  end
end

#shopqi_loginObject



11
12
13
14
15
16
17
# File 'app/controllers/shopqi_app/sessions_controller.rb', line 11

def 
  if signed_in?
    redirect_to main_app.root_path
  else
    redirect_to main_app.(shop: params[:shop])
  end
end