Improve debug logs in createAppRegisterHandler (#231)
This commit is contained in:
parent
a7cad6a3ec
commit
7c6c164a92
2 changed files with 11 additions and 3 deletions
5
.changeset/gorgeous-deers-lay.md
Normal file
5
.changeset/gorgeous-deers-lay.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"@saleor/app-sdk": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Improved and fixed debug logs in createAppRegistedHandler
|
|
@ -155,12 +155,15 @@ export const createAppRegisterHandler = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!validateAllowSaleorUrls(saleorApiUrl, allowedSaleorUrls)) {
|
if (!validateAllowSaleorUrls(saleorApiUrl, allowedSaleorUrls)) {
|
||||||
debug("Validation of URL %s against allowSaleorUrls param resolves to false, throwing");
|
debug(
|
||||||
|
"Validation of URL %s against allowSaleorUrls param resolves to false, throwing",
|
||||||
|
saleorApiUrl
|
||||||
|
);
|
||||||
|
|
||||||
return Response.Forbidden(
|
return Response.Forbidden(
|
||||||
createRegisterHandlerResponseBody(false, {
|
createRegisterHandlerResponseBody(false, {
|
||||||
code: "SALEOR_URL_PROHIBITED",
|
code: "SALEOR_URL_PROHIBITED",
|
||||||
message: "This app expects to be installed only in allowed saleor instances",
|
message: "This app expects to be installed only in allowed Saleor instances",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -188,7 +191,7 @@ export const createAppRegisterHandler = ({
|
||||||
createRegisterHandlerResponseBody(false, {
|
createRegisterHandlerResponseBody(false, {
|
||||||
code: "UNKNOWN_APP_ID",
|
code: "UNKNOWN_APP_ID",
|
||||||
message:
|
message:
|
||||||
"The auth data given during registration request could not be used to fetch app ID.",
|
"The auth data given during registration request could not be used to fetch app ID. This usually means that App could not connect to Saleor during installation",
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
status: 401,
|
status: 401,
|
||||||
|
|
Loading…
Reference in a new issue