rails google oauth2 not working on server

Viewed 169

In rails application we use google authentication for internal users. it works great on localhost and until last week also on our server. As of this weekend I'm getting this error

ActionController::RoutingError (No route matches [GET] "/auth/google_oauth2"):

Routes:


    require 'sidekiq/web'
    require_relative '../lib/superuser_constraint'
    mount Sidekiq::Web => '/sidekiq', :constraints => SuperuserConstraint.new
    get 'logout', to: 'sessions#destroy', as: 'logout'
    resources :sessions, only: [:new, :create, :destroy]
    
    get '/auth/:provider/callback' => 'sessions#omniauth'

    root 'home#index'

Initializer:

#config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
    provider :google_oauth2, Rails.application.credentials[:google_authentication][:client_id],Rails.application.credentials[:google_authentication][:client_secret], skip_jwt: true
end

Gemfile

gem 'omniauth'
gem 'omniauth-google-oauth2'

does anyone know why this is happening? I didn't make any changes to the application.

0 Answers
Related