Shopify / omniauth-shopify-oauth2

Shopify OAuth2 Strategy for OmniAuth 1.0

Home Page:http://shopify.github.io/omniauth-shopify-oauth2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

User gets redirected to "/auth/shopify" with routing error

usama520 opened this issue · comments

After using a nested route, I am getting an exception for routing error No route matches [GET] "/auth/shopify". Is there a way around this so that the setup callback gets triggered? Moreover, is there a way to trigger the callback manually so that I can avoid my page not found route getting triggered?

Can you give us steps to reproduce. For instance why and how are you getting No route matches [GET] "/auth/shopify"? What are you doing to get that. What does your config look like for your nested route. What is the output of rails routes. /auth/shopify is not the callback url /auth/shopify/callback is. No you cannot trigger it manually, at least not with anything that would help you because you cannot install and app/authenticate without negotiating with the external service.

When I started integrating this, I commented out all my existing routes and it worked perfectly. When I uncommented them, that's when I started facing the issue. Do you need me to post all my routes here? Do they even make a difference?

I have a devise route in my routes file as such which is causing the issue: devise_for :agents. Is there any workaround for this?

I am having the same issue, it was introduced with the update to shopify_app 18.0. I made no other changes from 17.2

For now I've rolled back to 17.2, hopefully a future release will fix it.

commented

@tanema - i'm having a hard time getting shopify_app to authenticate consistently. or at all in chrome. I came accross this post and this comment jumped out.

/auth/shopify is not the callback url /auth/shopify/callback is

When i try to install my demo app on a test store, it ends up with a InvalidAuthenticityToken error at that path. Should it not even be at that path? I do not think I have set anything to post there. Very default setup.


Started POST "/auth/shopify" for 88.97.13.38 at 2021-06-16 18:02:11 +0100
Cannot render console from 88.97.13.38! Allowed networks: 127.0.0.0/127.255.255.255, ::1
D, [2021-06-16T18:02:11.536897 #95197] DEBUG -- omniauth: (shopify) Setup endpoint detected, running now.
D, [2021-06-16T18:02:11.537058 #95197] DEBUG -- omniauth: (shopify) Request phase initiated.
E, [2021-06-16T18:02:11.537508 #95197] ERROR -- omniauth: (shopify) Authentication failure! ActionController::InvalidAuthenticityToken: ActionController::InvalidAuthenticityToken, ActionController::InvalidAuthenticityToken

Any help would be awesome. I am so stuck.

https://github.com/asecondwill/shopifydemo3