aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(static)/forgot/+page.server.ts
blob: e7476c2daf0406fbeba0464075b6d174194645bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { fail } from "@sveltejs/kit";
import { fd, post } from "$lib/utils";

export const actions = {
  default: async ({ request }) => {
    try {
      const { email } = await fd(request);
      await post("/forgot", { email });
      return { success: true };
    } catch (e: any) {
      return fail(400, { error: e.message });
    }
  },
};