App installation issue (Server error) review process of our app

App installation issue (Server error) review process of our app

gnusmusigor
Shopify Partner
5 0 2

After trying to submit our app the app is refused with error:

Resolve issues that are returning errors after authenticating with OAuth on install to comply with our requirements. You cannot request a merchant's .myshopify.com URL. See this screencast for additional details.

I have done OAuth strictly this guide.

@get(':gateway')
@HttpCode(HttpStatus.OK)
public async authorize(
  @Query() query: any,
  @Anonymous('gateway') gateway: string,
  @Req() req: Request,
  @Res() res: Response,
): Promise<any> {
  const oauth: OauthInterface = await this.shopifyService.OAuthDataExist(query.shop, gateway);
  if (oauth && oauth.accessToken) {
    res.redirect("Hello Word");
  } else {
    const nonce: string = uuid();
    await this.shopifyService.saveInitialOAuthData(query, gateway, nonce);

    const authorizeDto: any = {
      client_id: environment.paymentAppConfig[gateway].apiKey,
      redirect_uri: `${environment.shopifyAppTempMicroUrl}/installation/${gateway}`,
      scope: environment.shopifyScopes,
      state: nonce,
    };

    const str: string[] = [];
    for (const p in authorizeDto) {
      if (authorizeDto.hasOwnProperty(p)) {
        str.push(encodeURIComponent(p) + '=' + encodeURIComponent(authorizeDto[p]));
      }
    }

    const queryString: string = str.join('&');

    const OAuthAuthorizeUrl: string = `https://${query.shop}/admin/oauth/authorize?${queryString}&grant_options[]=value`;

    res.redirect(OAuthAuthorizeUrl);
  }
}


It works correct for my developer shops. But after submitting we can't pass review and 
intead to be redirected to redirect_uri -> /installation/:gateway the reviewer is getting the error Server Error.

Replies 0 (0)