Skip to content

Instantly share code, notes, and snippets.

@amitpatelx
Created October 12, 2017 10:41
Show Gist options
  • Save amitpatelx/c5a591d4ab3df42bdfe26f2f3e5c5600 to your computer and use it in GitHub Desktop.
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?
# 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: "" }
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
devise_for :users #, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
get '/auth/google_oauth2/callback' => 'users/omniauth_callbacks#google_oauth2'
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