From 02b352a3829b37c2b91cbbe1a876757bf0b4ae2f Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 14 Dec 2022 08:46:20 -0500 Subject: [PATCH] fix: Cross-subdomain redirect for shares with custom link --- server/routes/app.ts | 4 ++-- shared/i18n/locales/en_US/translation.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/routes/app.ts b/server/routes/app.ts index 4c7407cb8..f0ff616ce 100644 --- a/server/routes/app.ts +++ b/server/routes/app.ts @@ -96,10 +96,10 @@ export const renderShare = async (ctx: Context, next: Next) => { teamId: team?.id, }); share = result.share; - if (isUUID(shareId) && share && share.urlId) { + if (isUUID(shareId) && share?.urlId) { // Redirect temporarily because the url slug // can be modified by the user at any time - ctx.redirect(`/s/${share.urlId}`); + ctx.redirect(share.canonicalUrl); ctx.status = 307; } document = result.document; diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 206570d5e..0f1e8b11e 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -486,11 +486,11 @@ "Share nested documents": "Share nested documents", "Nested documents are publicly available": "Nested documents are publicly available", "Nested documents are not shared": "Nested documents are not shared", - "Custom link": "Custom link", - "The document will be available at": "The document will be available at", "Automatically redirect to the editor": "Automatically redirect to the editor", "Users with edit permission will be redirected to the main app": "Users with edit permission will be redirected to the main app", "All users see the same publicly shared view": "All users see the same publicly shared view", + "Custom link": "Custom link", + "The document will be available at": "The document will be available at", "More options": "More options", "Close": "Close", "{{ teamName }} is using Outline to share documents, please login to continue.": "{{ teamName }} is using Outline to share documents, please login to continue.",