mirror of
https://github.com/documenso/documenso.git
synced 2026-07-12 05:55:12 +10:00
fix(share): redirect unknown qr share tokens home instead of 404
This commit is contained in:
@@ -199,6 +199,12 @@ export const loader = async ({ request, params: { slug } }: Route.LoaderArgs) =>
|
||||
userAgent: requestMetadata.userAgent,
|
||||
});
|
||||
|
||||
// Unknown/invalid tokens keep the pre-existing public contract of
|
||||
// redirecting home. Policy denials below render status-coded pages.
|
||||
if (code === 'QR_VIEW_NOT_FOUND') {
|
||||
throw redirect('/');
|
||||
}
|
||||
|
||||
throw createQrShareErrorResponse({
|
||||
status,
|
||||
code,
|
||||
|
||||
Reference in New Issue
Block a user