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;