From 21c7787eed30cab43325a14b331ca75b4c5b1cd1 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 26 Apr 2021 17:45:09 +0200 Subject: [PATCH] web/flows: fix redirect loop when sentry is enabled Signed-off-by: Jens Langhammer --- web/src/api/Sentry.ts | 4 ++-- web/src/elements/sidebar/SidebarBrand.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/api/Sentry.ts b/web/src/api/Sentry.ts index ef7f9f2e4..e012bfd05 100644 --- a/web/src/api/Sentry.ts +++ b/web/src/api/Sentry.ts @@ -6,7 +6,7 @@ import { me } from "./Users"; import { config } from "./Config"; import { Config } from "authentik-api"; -export function configureSentry(): Promise { +export function configureSentry(canDoPpi: boolean = false): Promise { return config().then((config) => { if (config.errorReportingEnabled) { Sentry.init({ @@ -47,7 +47,7 @@ export function configureSentry(): Promise { }, }); console.debug("authentik/config: Sentry enabled."); - if (config.errorReportingSendPii) { + if (config.errorReportingSendPii && canDoPpi) { me().then(user => { Sentry.setUser({ email: user.user.email }); console.debug("authentik/config: Sentry with PII enabled."); diff --git a/web/src/elements/sidebar/SidebarBrand.ts b/web/src/elements/sidebar/SidebarBrand.ts index 63f8a2d6e..69873309d 100644 --- a/web/src/elements/sidebar/SidebarBrand.ts +++ b/web/src/elements/sidebar/SidebarBrand.ts @@ -41,7 +41,7 @@ export class SidebarBrand extends LitElement { } firstUpdated(): void { - configureSentry().then((c) => {this.config = c;}); + configureSentry(true).then((c) => {this.config = c;}); } render(): TemplateResult {