Skip to content
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

Merged
merged 7 commits into from Jan 29, 2016
Merged

Update devise 3.5 #1675

merged 7 commits into from Jan 29, 2016

Conversation

rap1ds
Copy link
Member

@rap1ds rap1ds commented Jan 28, 2016

Update Devise gem to 3.5

TODO

@@ -65,6 +65,9 @@

resources :communities, only: [:new, :create]


devise_for :people, only: :omniauth_callbacks, controllers: { omniauth_callbacks: "sessions"}
Copy link
Contributor

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?

Copy link
Member Author

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)

Copy link
Member Author

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
rap1ds added a commit that referenced this pull request Jan 29, 2016
@rap1ds rap1ds merged commit d15427c into master Jan 29, 2016
@rap1ds rap1ds deleted the update-devise-3.5 branch January 29, 2016 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants