Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

decodeURIComponent instead

Steven Teyf8b168eb20a6
diff --git a/apps/web/lib/zod/schemas/oauth.ts b/apps/web/lib/zod/schemas/oauth.ts
index 5f03520bbb..5faae72fec 100644
--- a/apps/web/lib/zod/schemas/oauth.ts
+++ b/apps/web/lib/zod/schemas/oauth.ts
@@ -49,9 +49,13 @@ export const authorizeRequestSchema = z.object({
.string()
.nullable()
.transform((scope) => {
- // split by comma or space or plus sign
+ // decode the scope parameter and split by comma or space
const scopes = [
- ...new Set((scope ?? "").split(/[,\s+]/).filter(Boolean)),
+ ...new Set(
+ decodeURIComponent(scope ?? "")
+ .split(/[,\s]/)
+ .filter(Boolean),
+ ),
];
if (!scopes.includes("user.read")) {