Open gabriel-rye opened 2 months ago
Currently, my working around to make this work in remix is to instantiate another shopify-api client and use the methods.
Hi @gabriel-rye, thank you for opening this issue, we'll take a look.
@matteodepalo, thanks! In general, we're looking for a way to get data when our users follow the installation link during the installation process. We currently use the installation link's state param and custom callback. But if somehow remix-shopify-app provides this param in the afterAuth
or new hooks like: handleStateParamFromAuth
or something would work.
I'm having the exact same requirement / issue as @gabriel-rye . Any updates on this? having access to the param on afterAuth
(or new hook as suggested) would be ideal. @gabriel-rye, can you expand on your workaround please? I'm currently having to call an API from MyApp
, and pass the store host + accessToken - but I would also need to pass this state parameter coming from the custom installation URL
OK - my approach was to save the custom parameter on a Prisma model and access it on afterAuth
.
Hey folks! Yeah my approach was to save the state param since the normal flow would be to exist the iframe and get back with cookie set making the auth flow complete. In the afterAuth you check if there is a state attached in db to the shop if so, do the custom setup logic.
On Mon, 14 Oct 2024 at 10:12 Tiago Reis @.***> wrote:
OK - my approach was to save the custom parameter on a Prisma model and access it on afterAuth.
— Reply to this email directly, view it on GitHub https://github.com/Shopify/shopify-app-js/issues/1554#issuecomment-2411232219, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJ5W4NTWYBYMBAFWZRDJIPDZ3O7NHAVCNFSM6AAAAABOXDOMV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJRGIZTEMRRHE . You are receiving this because you were mentioned.Message ID: @.***>
Issue summary
Before opening this issue, I have:
@shopify/*
package and version:{ logger: { level: LogSeverity.Debug } }
in my configuration, when applicableExpected behavior
Im trying to complete the callback process on a custom auth callback. Using a custom installation link like
https://rye-gabriel-test.myshopify.com/admin/oauth/authorize?client_id=X&scope=unauthenticated_read_product_listings&redirect_uri=https://princeton-engineers-scenic-arrow.trycloudflare.com/api/auth/callback&state=123
Shopify will call
/api/auth/callback
but when callingconst { session, admin, redirect } = await authenticate.admin(request);
in this route breaks the auth process.It looks like the auth process can't handle custom callback uri since it always
/auth/callback
, causing it to fail sincein
respondToOAuthRequests
for AuthCode Strategy can't handle custom callback uri. and inderiveConfig
you override auth config.My use is: I want to use the state parameter to do a custom logic during installation and I can only access it using custom redirect_uri and also need the session.
If I could have
This available in remix would make life easier.
Actual behavior
What actually happens?
Steps to reproduce the problem
[shopify-app/DEBUG] Authenticate returned a response
with a 302Debug logs
it throws a 302 response error because it tries to ensureAppIsInstalled but it already is my guess.