fix: resolve TypeScript errors in domain-block-api test (Task 8)
This commit is contained in:
@@ -6,14 +6,17 @@ import { isDeckyVaultEmail, DOMAIN_BLOCK_ERROR } from "@/lib/auth/domain-block"
|
|||||||
* The domain-block onBeforeHandle handler – mirrors the logic
|
* The domain-block onBeforeHandle handler – mirrors the logic
|
||||||
* wired into the auth group in lib/api/app.ts. Tested in isolation
|
* wired into the auth group in lib/api/app.ts. Tested in isolation
|
||||||
* here so we don't need to stand up the full app / DB.
|
* here so we don't need to stand up the full app / DB.
|
||||||
|
*
|
||||||
|
* The handler is typed loosely to avoid Elysia's complex context type
|
||||||
|
* in test environments — the actual type safety is verified against
|
||||||
|
* the real app.ts implementation at integration test time.
|
||||||
*/
|
*/
|
||||||
const domainBlockOnBeforeHandle = async ({
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
request,
|
const domainBlockOnBeforeHandle = async (context: any) => {
|
||||||
set,
|
const { request, set } = context as {
|
||||||
}: {
|
|
||||||
request: Request
|
request: Request
|
||||||
set: { status: number }
|
set: { status: number }
|
||||||
}) => {
|
}
|
||||||
const url = new URL(request.url)
|
const url = new URL(request.url)
|
||||||
const isSignUp =
|
const isSignUp =
|
||||||
url.pathname === "/api/auth/sign-up/email" &&
|
url.pathname === "/api/auth/sign-up/email" &&
|
||||||
|
|||||||
Reference in New Issue
Block a user