I have written a very simply Shopify app based on the latest template and I did not touch any part about the OAuth, and the app installed and worked just fine when I run in dev mode. After I deploy it on fly.io, when I try to install it, the redirect_uri in the OAuth url becomes
redirect_uri=little-haze-0000.fly.dev://little-haze-0000.fly.dev/api/auth/callback
, and it gave an error “Oauth error invalid_request: The redirect_uri is not whitelisted” (of course it is wrong!).
Obviously there should be a “https” in front of the “://”. I manually change the parameter to
redirect_uri=https://little-haze-0000.fly.dev/api/auth/callback
and the app can be successfully installed. I looked through the code and app setting in my partner account and can’t find anywhere I can modify the redirect_uri. I wonder where I did wrong?