Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appBaseUrl in Saleor app assigned wrong host when deploying to AWS Amplify #997

Open
madmonkeyworks opened this issue Sep 7, 2023 · 1 comment

Comments

@madmonkeyworks
Copy link

Hi there,

We are deploying our custom Saleor App on AWS Amplify. For some reason, the manifest reads wrong base URLs.

Generated app manifest

...
appUrl: "https://prod.eu-west-3.gateway.amplify.aws.dev"
tokenTargetUrl: "https://prod.eu-west-3.gateway.amplify.aws.dev/api/register"

Correct URL should read
https://test-supreetha.ds7pxky06vb7t.amplifyapp.com
which is the Amplify app default URL.

We also use the env variables, and we see that these are loaded well during the build.

APP_IFRAME_BASE_URL=https://test-supreetha.ds7pxky06vb7t.amplifyapp.com
APP_API_BASE_URL=https://test-supreetha.ds7pxky06vb7t.amplifyapp.com

I'm waiting for an answer from aws amplify-hosting, meanwhile I thought I'll ask here as well.

How and when is the app base URL assigned?

Any thoughts? Thank you!

@lkostrowski
Copy link
Member

Hi

not sure which app are you deploying, but check your src/pages/api/manifest.ts function

it contains tokenTargetUrl field. Its set to ${apiBaseURL}/api/register by default, because the app has another function - pages/api/register.ts

If you have different path for register endpoint (or e.g. use rewrite), just update this path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants