refactor: remove the deprecated auth options
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,6 @@ import { createPluginRunner } from "@wrnexus/plugin";
|
||||
import { authPlugin } from "../src/plugin.ts";
|
||||
import { AUTH_ROUTE_DEFINITIONS } from "../src/routes/definitions.ts";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { getDefaultAuthRouteOptions } from "../src/runtime.ts";
|
||||
|
||||
test("plugin contributes components, runtime, styles, migration, and toolbar", async () => {
|
||||
const metadata = new Map<string, unknown>();
|
||||
@@ -70,28 +69,6 @@ test("config.auth controls route groups and migrations without explicit plugin o
|
||||
expect(contributions.routes.some((route) => route.path === "/api/auth/login")).toBe(true);
|
||||
});
|
||||
|
||||
test("config.auth resolves navigation hooks from the configured engine", async () => {
|
||||
const onSignedIn = () => new Response(null, { status: 204 });
|
||||
const onSignedOut = () => new Response(null, { status: 204 });
|
||||
const runner = createPluginRunner(authPlugin(), {
|
||||
root: process.cwd(),
|
||||
mode: "development",
|
||||
command: "dev",
|
||||
metadata: new Map(),
|
||||
warn() {},
|
||||
});
|
||||
|
||||
await runner.configure({
|
||||
auth: {
|
||||
engine: { onSignedIn, onSignedOut } as never,
|
||||
routes: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(getDefaultAuthRouteOptions().onSignedIn).toBe(onSignedIn);
|
||||
expect(getDefaultAuthRouteOptions().onSignedOut).toBe(onSignedOut);
|
||||
});
|
||||
|
||||
test("auth runtime contains built-in browser schemas", async () => {
|
||||
const metadata = new Map<string, unknown>();
|
||||
const runner = createPluginRunner(authPlugin({ includeMigrations: false }), {
|
||||
|
||||
Reference in New Issue
Block a user