Created
October 12, 2017 10:41
-
-
Save amitpatelx/c5a591d4ab3df42bdfe26f2f3e5c5600 to your computer and use it in GitHub Desktop.
How to fix No route matches [GET] “/auth/shopify” after introducing devise with Omniauth?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Commented the following line, moved it to omniauth.rb | |
# config.omniauth :google_oauth2, Settings.google.client_id, Settings.google.client_secret, { access_type: "offline", approval_prompt: "" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.config.middleware.use OmniAuth::Builder do | |
provider :shopify, | |
ShopifyApp.configuration.api_key, | |
ShopifyApp.configuration.secret, | |
scope: ShopifyApp.configuration.scope, | |
callback_path: "#{Settings.shopify.mounted_at}/auth/shopify/callback" | |
provider :google_oauth2, | |
Settings.google.client_id, | |
Settings.google.client_secret, | |
{ access_type: "offline", approval_prompt: "" } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devise_for :users #, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' } | |
get '/auth/google_oauth2/callback' => 'users/omniauth_callbacks#google_oauth2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ApplicationRecord | |
devise :database_authenticatable, :rememberable, :trackable, :validatable #, :omniauthable | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment