Class: ShopifyApp::CallbackController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- ShopifyApp::CallbackController
- Includes:
- LoginProtection
- Defined in:
- app/controllers/shopify_app/callback_controller.rb
Overview
Performs login after OAuth completes
Instance Method Summary collapse
Methods included from LoginProtection
#activate_shopify_session, #current_shopify_session, #login_again_if_different_user_or_shop, #shop_session, #shop_session_by_cookie, #shop_session_by_jwt, #user_session, #user_session_by_cookie, #user_session_by_jwt
Instance Method Details
#callback ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/shopify_app/callback_controller.rb', line 8 def callback unless auth_hash return respond_with_error end if jwt_request? && !valid_jwt_auth? return respond_with_error end if jwt_request? set_shopify_session head(:ok) else set_shopify_session if redirect_for_user_token? return redirect_to(login_url_with_optional_shop) end install_webhooks perform_after_authenticate_job redirect_to(return_address) end end |