Files
outline/plugins/email/server/auth/schema.ts
codegen-sh[bot]andTom Moor d2aba1de96 feat: Add POST method option to redirectOnClient (#9228)
* feat: Add POST method option to redirectOnClient helper

* Applied automatic fixes

* fix: Add missing closing HTML tag in redirectOnClient GET method

* fix: Use lodash escape for form field values to prevent XSS

* Applied automatic fixes

* fix: Add missing lodash/escape import

* Applied automatic fixes

* fix: Escape all URLs in redirectOnClient function

* Update index.ts

* fix: CSP

* Refactor CSP middleware

* docs, only use for email signin

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-05-17 09:06:32 -04:00

28 lines
764 B
TypeScript

import { z } from "zod";
import { Client } from "@shared/types";
import { BaseSchema } from "@server/routes/api/schema";
export const EmailSchema = BaseSchema.extend({
body: z.object({
email: z.string().email(),
client: z.nativeEnum(Client).default(Client.Web),
}),
});
export type EmailReq = z.infer<typeof EmailSchema>;
export const EmailCallbackSchema = BaseSchema.extend({
query: z.object({
token: z.string().optional(),
client: z.nativeEnum(Client).default(Client.Web),
follow: z.string().default(""),
}),
body: z.object({
token: z.string().optional(),
client: z.nativeEnum(Client).default(Client.Web),
follow: z.string().default(""),
}),
});
export type EmailCallbackReq = z.infer<typeof EmailCallbackSchema>;