fix: Cross-subdomain redirect for shares with custom link

This commit is contained in:
Tom Moor
2022-12-14 08:46:20 -05:00
parent 79829a3129
commit 02b352a382
2 changed files with 4 additions and 4 deletions

View File

@@ -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;

View File

@@ -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.",