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:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user