From a2b38caf649000bc047dcdf9209ad316c872e38f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 29 Nov 2021 13:58:00 +0100 Subject: [PATCH] web: update for new config api Signed-off-by: Jens Langhammer --- web/src/api/Sentry.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/api/Sentry.ts b/web/src/api/Sentry.ts index 70dee4290..210f54e40 100644 --- a/web/src/api/Sentry.ts +++ b/web/src/api/Sentry.ts @@ -11,7 +11,7 @@ export const TAG_SENTRY_CAPABILITIES = "authentik.capabilities"; export function configureSentry(canDoPpi: boolean = false): Promise { return config().then((config) => { - if (config.errorReportingEnabled) { + if (config.errorReporting.enabled) { Sentry.init({ dsn: "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8", ignoreErrors: [ @@ -25,8 +25,8 @@ export function configureSentry(canDoPpi: boolean = false): Promise { tracingOrigins: [window.location.host, "localhost"], }), ], - tracesSampleRate: 0.6, - environment: config.errorReportingEnvironment, + tracesSampleRate: config.errorReporting.tracesSampleRate, + environment: config.errorReporting.environment, beforeSend: async (event: Sentry.Event, hint: Sentry.EventHint): Promise => { if (hint.originalException instanceof SentryIgnoredError) { return null; @@ -43,7 +43,7 @@ export function configureSentry(canDoPpi: boolean = false): Promise { const intf = window.location.pathname.replace(/.+if\/(.+)\//, "$1"); Sentry.setTag(TAG_SENTRY_COMPONENT, `web/${intf}`); } - if (config.errorReportingSendPii && canDoPpi) { + if (config.errorReporting.sendPii && canDoPpi) { me().then(user => { Sentry.setUser({ email: user.user.email }); console.debug("authentik/config: Sentry with PII enabled.");