spree_social icon indicating copy to clipboard operation
spree_social copied to clipboard

Authentication path does not include the path Spree is mounted at

Open lailsonbm opened this issue 10 years ago • 3 comments

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

  1. Create a new spree app, as described in the Getting Started guide.
  2. In the routes, change the path of the Spree engine to :at => '/store'.
  3. Install spree_social as described in the README and create a authentication method in the Spree Admin (Facebook, for example).
  4. Notice that the authentication URL is /users/auth/facebook, instead of /store/users/auth/facebook, as expected.
  5. 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.

lailsonbm avatar Apr 18 '14 21:04 lailsonbm

The issue seems to be related with Devise + Omniauth: https://github.com/plataformatec/devise/issues/2692

lailsonbm avatar Apr 18 '14 23:04 lailsonbm

seems related to #107

gduquesnay avatar Apr 30 '14 16:04 gduquesnay

Agreed, related to #107.

radar avatar May 06 '14 05:05 radar