aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.server.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js
index e3c6ba74..933993a2 100644
--- a/src/routes/(app)/send/invoice/[id]/+page.server.js
+++ b/src/routes/(app)/send/invoice/[id]/+page.server.js
@@ -15,6 +15,8 @@ export async function load({ params: { id }, parent, url }) {
if (invoice.user.username === user?.username)
error(500, { message: "Cannot send to self" });
+ if (!user) redirect(307, `/${invoice.user.username}/invoice/${id}`);
+
return { invoice, rates, user };
}