spree_social
spree_social copied to clipboard
Authentication path does not include the path Spree is mounted at
When the Spree engine is mounted at a custom path (such as /store
), the authentication path provided by spree_social (/users/auth/:provider
by default) does not include this path.
This issue would be easy to solve by setting Spree::SocialConfig[:path_prefix] = 'store/users'
, but the problem is that the callback path (/users/auth/:provider/callback
by default) does include the prefix, so when the :path_prefix
is configured in this way, the actual callback route becomes /store/store/users/auth/facebook/callback
.
As expected, this makes the callback chain to fail because the app asked the provider to redirect to /store/users/auth/facebook/callback
. So, which behavior is correct?
Steps to reproduce the bug
- Create a new spree app, as described in the Getting Started guide.
- In the routes, change the path of the Spree engine to
:at => '/store'
. - Install
spree_social
as described in the README and create a authentication method in the Spree Admin (Facebook, for example). - Notice that the authentication URL is
/users/auth/facebook
, instead of/store/users/auth/facebook
, as expected. - When this path is accessed, it redirects to
/users/auth/facebook/callback
, but the user gets an error, because this URL does not exists. It is in fact/store/users/auth/facebook/callback
.
I'm currently investigating how to fix this. Please just confirm whether the expected behavior is to include the Spree engine path in all paths generated by the spree social.
The issue seems to be related with Devise + Omniauth: https://github.com/plataformatec/devise/issues/2692
seems related to #107
Agreed, related to #107.