Change Omniauth Authorization URL

I am using Omniauth with Devise using a strategy google_oauth2. It works well, but now I would like to change the authorization path with something of my choice.

Actually it is http://localhost:3000/users/auth/google_oauth2, while I would like it a lot easier http://localhost:3000/login, as it was easy to remember.

This would not cause any error since I disconnected the authenticated Devise database (the only way to log in using google account).

How can i do this?

Thank.

+5
source share
2 answers

OmniAuth
omniauth, new_user_session ( , root). ( , omniauth):

devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }

devise_scope :user do
  get 'sign_in', :to => 'users/sessions#new', :as => :new_user_session
  get 'sign_out', :to => 'users/sessions#destroy', :as => :destroy_user_session
end

. , .

: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

-1

All Articles