aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/forgot/+page.server.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-08-30 20:04:29 -0700
committerAdam Soltys <[email protected]>2024-08-30 20:04:29 -0700
commitdf71664f20312e81134ee90ad561f55d3020ee0a (patch)
tree3986d1c5aac77f256ed1091290bc067c899e2196 /src/routes/(app)/forgot/+page.server.ts
parent20337319212896c484ac0f8d3dfbac3b8d26f089 (diff)
downloadcoinos-ui-df71664f20312e81134ee90ad561f55d3020ee0a.tar.gz
coinos-ui-df71664f20312e81134ee90ad561f55d3020ee0a.zip
typescript
Diffstat (limited to 'src/routes/(app)/forgot/+page.server.ts')
-rw-r--r--src/routes/(app)/forgot/+page.server.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/routes/(app)/forgot/+page.server.ts b/src/routes/(app)/forgot/+page.server.ts
new file mode 100644
index 00000000..48411539
--- /dev/null
+++ b/src/routes/(app)/forgot/+page.server.ts
@@ -0,0 +1,14 @@
+import { fail, redirect } from "@sveltejs/kit";
+import { fd, post, login } from "$lib/utils";
+
+export const actions = {
+ default: async ({ request }) => {
+ try {
+ let { email } = await fd(request);
+ await post("/forgot", { email });
+ return { success: true };
+ } catch (e) {
+ return fail(400, { error: e.message });
+ }
+ },
+};