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.

Update app-redirect.ts

Steven Teyc8fad0507a23
diff --git a/apps/web/lib/middleware/utils/app-redirect.ts b/apps/web/lib/middleware/utils/app-redirect.ts
index 1bb38f59a5..707cd2c8c2 100644
--- a/apps/web/lib/middleware/utils/app-redirect.ts
+++ b/apps/web/lib/middleware/utils/app-redirect.ts
@@ -3,8 +3,10 @@ const APP_REDIRECTS = {
};
export const appRedirect = (path: string) => {
- if (path.endsWith("/settings/library") || path.endsWith("/settings/tags")) {
- return "/settings/library/tags";
+ // Use a regex to match both "/settings/library" and "/settings/tags"
+ const libraryTagsRegex = /\/settings\/(library|tags)$/;
+ if (libraryTagsRegex.test(path)) {
+ return path.replace(libraryTagsRegex, "/settings/library/tags");
} else if (APP_REDIRECTS[path]) {
return APP_REDIRECTS[path];
}