mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +03:00
* 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>
28 lines
764 B
TypeScript
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>;
|