Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ninety-heads-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/service-utils": patch
---

update error response url
4 changes: 2 additions & 2 deletions packages/service-utils/src/core/authorize/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe("authorizeClient", () => {
) as any;
expect(result.authorized).toBe(false);
expect(result.errorMessage).toBe(
"Invalid request: Unauthorized Bundle ID: com.foo.bar. You can view the restrictions on this API key at https://thirdweb.com/create-api-key",
"Invalid request: Unauthorized Bundle ID: com.foo.bar. You can view the restrictions for this project at https://thirdweb.com/test-team/test-project/settings",
);
expect(result.errorCode).toBe("BUNDLE_UNAUTHORIZED");
expect(result.status).toBe(401);
Expand All @@ -101,7 +101,7 @@ describe("authorizeClient", () => {
) as any;
expect(result.authorized).toBe(false);
expect(result.errorMessage).toBe(
"Invalid request: Unauthorized domain: unauthorized.com. You can view the restrictions on this API key at https://thirdweb.com/create-api-key",
"Invalid request: Unauthorized domain: unauthorized.com. You can view the restrictions for this project at https://thirdweb.com/test-team/test-project/settings",
);
expect(result.errorCode).toBe("ORIGIN_UNAUTHORIZED");
expect(result.status).toBe(401);
Expand Down
4 changes: 2 additions & 2 deletions packages/service-utils/src/core/authorize/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function authorizeClient(
return {
authorized: false,
errorCode: "ORIGIN_UNAUTHORIZED",
errorMessage: `Invalid request: Unauthorized domain: ${origin}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
errorMessage: `Invalid request: Unauthorized domain: ${origin}. You can view the restrictions for this project at https://thirdweb.com/${team.slug}/${project.slug}/settings`,
status: 401,
};
}
Expand All @@ -81,7 +81,7 @@ export function authorizeClient(
return {
authorized: false,
errorCode: "BUNDLE_UNAUTHORIZED",
errorMessage: `Invalid request: Unauthorized Bundle ID: ${bundleId}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
errorMessage: `Invalid request: Unauthorized Bundle ID: ${bundleId}. You can view the restrictions for this project at https://thirdweb.com/${team.slug}/${project.slug}/settings`,
status: 401,
};
}
Expand Down
4 changes: 2 additions & 2 deletions packages/service-utils/src/core/authorize/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function authorizeService(
return {
authorized: false,
errorCode: "SERVICE_UNAUTHORIZED",
errorMessage: `Invalid request: Unauthorized service: ${serviceConfig.serviceScope} for project: ${project.name} (${project.publishableKey}). You can view the restrictions on this project in your dashboard: https://thirdweb.com`,
errorMessage: `Invalid request: Unauthorized service: ${serviceConfig.serviceScope} for project: ${project.name} (${project.publishableKey}). You can view the restrictions for this project at https://thirdweb.com/${team.slug}/${project.slug}/settings`,
status: 403,
};
}
Expand All @@ -57,7 +57,7 @@ export function authorizeService(
return {
authorized: false,
errorCode: "SERVICE_ACTION_UNAUTHORIZED",
errorMessage: `Invalid request: Unauthorized action: ${serviceConfig.serviceScope} ${serviceConfig.serviceAction} for project: ${project.name} (${project.publishableKey}). You can view the restrictions on this API key in your dashboard: https://thirdweb.com/create-api-key`,
errorMessage: `Invalid request: Unauthorized action: ${serviceConfig.serviceScope} ${serviceConfig.serviceAction} for project: ${project.name} (${project.publishableKey}). You can view the restrictions for this project at https://thirdweb.com/${team.slug}/${project.slug}/settings`,
status: 403,
};
}
Expand Down
Loading