show correct error message when the VPP token is invalid (#21744)

relates to #21725

shows the correct UI error when a user tries to upload an invalid token

- [x] Added/updated tests
This commit is contained in:
Gabriel Hernandez 2024-09-03 17:04:55 +01:00 committed by GitHub
parent 004ed9fc9a
commit 6de73537a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,7 +20,7 @@ export const getErrorMessage = (err: unknown) => {
reasonIncludes: "Duplicate entry",
});
const invalidTokenReason = getErrorReason(err, {
reasonIncludes: "invalid",
reasonIncludes: "Invalid token",
});
if (duplicateEntryReason) {
@ -28,7 +28,7 @@ export const getErrorMessage = (err: unknown) => {
}
if (invalidTokenReason) {
return "Invalid token. Please provide a valid token from Apple Business Manager.";
return invalidTokenReason;
}
return DEFAULT_ERROR_MESSAGE;