Umi and Satomi


When you want to use url with locale, OAuth using Devise & OmniAuth has error at callback. How to resolve?

Edit config/routes.rb, set only ominauth_callbacks outside of scope of locale.

Rails.application.routes.draw do
  devise_for :users,
  skip: [
  controllers: {
    omniauth_callbacks: 'users/omniauth_callbacks'

  scope '(:locale)', locale: /en/ do
    get 'omniauth/:provider' => 'users/omniauth#localized', as: :localized_omniauth
    devise_for :users,
    skip: :omniauth_callbacks,
    controllers: {
      sessions:            'users/sessions',
      registrations:       'users/registrations',
      passwords:           'users/passwords',
      confirmations:       'users/confirmations'