feat(auth): add remembered local login to the frontend
This commit is contained in:
@@ -2,7 +2,7 @@ export class FakeEventSource {
|
||||
static instances: FakeEventSource[] = [];
|
||||
onmessage: ((e: { data: string; lastEventId: string }) => void) | null = null;
|
||||
onopen: (() => void) | null = null;
|
||||
onerror: (() => void) | null = null;
|
||||
onerror: ((event?: unknown) => void) | null = null;
|
||||
closed = false;
|
||||
private listeners = new Map<string, Set<(e: { data: string; lastEventId: string }) => void>>();
|
||||
private historicalListeners = new Map<
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import { setupServer } from "msw/node";
|
||||
import { http, HttpResponse } from "msw";
|
||||
export const server = setupServer(
|
||||
http.get("/api/auth/config", () => HttpResponse.json({ mode: "local", localLogin: true, oidcLogin: false })),
|
||||
http.get("/api/me", () => HttpResponse.json({
|
||||
issuer: "mock", subject: "test-user", displayName: "Test user", roles: ["admin"],
|
||||
permissions: [
|
||||
"session.use", "session.read_all", "session.manage_all", "settings.manage",
|
||||
"workspace.manage", "workspace.secrets.manage", "pi.manage", "auth.diagnostics.read",
|
||||
], isAdmin: true, csrfToken: "c".repeat(43), session: null,
|
||||
})),
|
||||
http.get("/api/health/dwh", () => HttpResponse.json({ ok: true, detail: "ok" })),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user