Module: ShopifyApp::SessionsController
- Extended by:
- ActiveSupport::Concern
- Included in:
- SessionsController
- Defined in:
- lib/shopify_app/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#callback ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/shopify_app/sessions_controller.rb', line 13 def callback if response = request.env['omniauth.auth'] sess = ShopifyAPI::Session.new(params[:shop], response['credentials']['token']) session[:shopify] = ShopifyApp::SessionRepository.store(sess) flash[:notice] = "Logged in" redirect_to return_address else flash[:error] = "Could not log in to Shopify store." redirect_to :action => 'new' end end |
#create ⇒ Object
9 10 11 |
# File 'lib/shopify_app/sessions_controller.rb', line 9 def create authenticate end |
#destroy ⇒ Object
25 26 27 28 29 30 |
# File 'lib/shopify_app/sessions_controller.rb', line 25 def destroy session[:shopify] = nil flash[:notice] = "Successfully logged out." redirect_to :action => 'new' end |
#new ⇒ Object
5 6 7 |
# File 'lib/shopify_app/sessions_controller.rb', line 5 def new authenticate if params[:shop].present? end |