aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/forgot/+page.server.ts
blob: de440f020a1b9130b15d2129514619648ce6bcc7 (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 {
      let { email } = await fd(request);
      await post("/forgot", { email });
      return { success: true };
    } catch (e: any) {
      return fail(400, { error: e.message });
    }
  },
};