New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update devise 3.5 #1675
Update devise 3.5 #1675
Conversation
199642a
to
80e5a7f
Compare
@@ -65,6 +65,9 @@ | |||
|
|||
resources :communities, only: [:new, :create] | |||
|
|||
|
|||
devise_for :people, only: :omniauth_callbacks, controllers: { omniauth_callbacks: "sessions"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you quickly explain the effects and idea of pulling omniauth_callbacks here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the instructions Devise gave me:
/Users/mikko/.rvm/gems/ruby-2.1.2/gems/devise-3.5.4/lib/devise/rails/routes.rb:418:in `devise_omniauth_callback':
Devise does not support scoping OmniAuth callbacks under a dynamic segment
and you have set "/(/:locale)/people". You can work around by passing
`skip: :omniauth_callbacks` to the `devise_for` call and extract omniauth
options to another `devise_for` call outside the scope. Here is an example:
devise_for :users, only: :omniauth_callbacks, controllers: {omniauth_callbacks: 'users/omniauth_callbacks'}
scope '/(:locale)', locale: /ru|en/ do
devise_for :users, skip: :omniauth_callbacks
end
(RuntimeError)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To my understanding this doesn't have any major effect. The path for the omniauth callback is fetched from person_omniauth_authorize_path
method, so I guess from now on that method returns a path without any locale in it?
Anyway, I tested this and FB auth seems to be working normally.
This change removes the warning: `devise_omniauth_callback': Devise does not support scoping OmniAuth callbacks under a dynamic segment and you have set "/(/:locale)/people". You can work around by passing `skip: :omniauth_callbacks` to the `devise_for` call and extract omniauth options to another `devise_for` call outside the scope. Here is an example: devise_for :users, only: :omniauth_callbacks, controllers: {omniauth_callbacks: 'users/omniauth_callbacks'} scope '/(:locale)', locale: /ru|en/ do devise_for :users, skip: :omniauth_callbacks end
80e5a7f
to
742bfbf
Compare
Update Devise gem to 3.5
TODO