build(deps): bump @sentry/browser from 6.19.4 to 7.0.0 in /web (#3008)
This commit is contained in:
@ -3,7 +3,6 @@ import { getCookie } from "../utils";
|
||||
import { APIMiddleware } from "../elements/notifications/APIDrawer";
|
||||
import { MessageMiddleware } from "../elements/messages/Middleware";
|
||||
import { VERSION } from "../constants";
|
||||
import { getMetaContent } from "@sentry/tracing/dist/browser/browsertracing";
|
||||
|
||||
export class LoggingMiddleware implements Middleware {
|
||||
|
||||
@ -58,10 +57,16 @@ export class CSRFMiddleware implements Middleware {
|
||||
}
|
||||
}
|
||||
|
||||
export function getMetaContent(key: string): string {
|
||||
const metaEl = document.querySelector<HTMLMetaElement>(`meta[name=${key}]`);
|
||||
if (!metaEl) return "";
|
||||
return metaEl.content;
|
||||
}
|
||||
|
||||
export const DEFAULT_CONFIG = new Configuration({
|
||||
basePath: process.env.AK_API_BASE_PATH + "/api/v3",
|
||||
headers: {
|
||||
"sentry-trace": getMetaContent("sentry-trace") || "",
|
||||
"sentry-trace": getMetaContent("sentry-trace"),
|
||||
},
|
||||
middleware: [
|
||||
new CSRFMiddleware(),
|
||||
|
@ -9,7 +9,7 @@ import { Config } from "@goauthentik/api";
|
||||
export const TAG_SENTRY_COMPONENT = "authentik.component";
|
||||
export const TAG_SENTRY_CAPABILITIES = "authentik.capabilities";
|
||||
|
||||
export function configureSentry(canDoPpi: boolean = false): Promise<Config> {
|
||||
export function configureSentry(canDoPpi = false): Promise<Config> {
|
||||
return config().then((config) => {
|
||||
if (config.errorReporting.enabled) {
|
||||
Sentry.init({
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user