web/NPM Workspaces: Prep ESBuild plugin for publish. (#14552)

* web: Prep ESBuild plugin for publish.

* prettier-config: Update deps.

* eslint-config: Update deps.

* docusaurus-config: Update deps.

* docs: Update deps.

* docs: Enable linter.

* docs: Lint.

* web/sfe: Clean up types. Prep for monorepo.

* esbuild-plugin-live-reload: Update deps.

* web: Tidy ESLint, script commands.

* web: Fix logs.

* web: Lint.

* web: Split compile check from cached version.
This commit is contained in:
Teffen Ellis
2025-05-21 22:09:33 +02:00
committed by GitHub
parent f48496b2cf
commit 614740a4ff
43 changed files with 7478 additions and 5935 deletions

View File

@ -39,8 +39,11 @@ export class LoggingMiddleware implements Middleware {
export class CSRFMiddleware implements Middleware {
pre?(context: RequestContext): Promise<FetchParams | void> {
// @ts-ignore
context.init.headers[CSRFHeaderName] = getCookie("authentik_csrf");
context.init.headers = {
...context.init.headers,
[CSRFHeaderName]: getCookie("authentik_csrf"),
};
return Promise.resolve(context);
}
}

View File

@ -4,14 +4,18 @@ import { FetchParams, Middleware, RequestContext } from "@goauthentik/api";
export class SentryMiddleware implements Middleware {
pre?(context: RequestContext): Promise<FetchParams | void> {
if (getCurrentScope().getClient === undefined) {
if (!getCurrentScope().getClient) {
return Promise.resolve(context);
}
const traceData = getTraceData();
// @ts-ignore
context.init.headers["baggage"] = traceData["baggage"];
// @ts-ignore
context.init.headers["sentry-trace"] = traceData["sentry-trace"];
context.init.headers = {
...context.init.headers,
"baggage": traceData.baggage || "",
"sentry-trace": traceData["sentry-trace"] || "",
};
return Promise.resolve(context);
}
}