diff --git a/authentik/lib/sentry.py b/authentik/lib/sentry.py index c65c96ddd..0868bd7e3 100644 --- a/authentik/lib/sentry.py +++ b/authentik/lib/sentry.py @@ -72,7 +72,7 @@ def sentry_init(**sentry_init_kwargs): ], before_send=before_send, release=f"authentik@{__version__}", - **kwargs + **kwargs, ) set_tag("authentik.build_hash", get_build_hash("tagged")) set_tag("authentik.env", get_env()) @@ -82,6 +82,7 @@ def sentry_init(**sentry_init_kwargs): env=kwargs["environment"], ) + def before_send(event: dict, hint: dict) -> Optional[dict]: """Check if error is database error, and ignore if so""" # pylint: disable=no-name-in-module diff --git a/authentik/lib/tests/test_sentry.py b/authentik/lib/tests/test_sentry.py index 8ad6f7954..958ef5041 100644 --- a/authentik/lib/tests/test_sentry.py +++ b/authentik/lib/tests/test_sentry.py @@ -13,4 +13,4 @@ class TestSentry(TestCase): def test_error_sent(self): """Test error sent""" - self.assertEqual(None, before_send({}, {"exc_info": (0, ValueError(), 0)})) + self.assertEqual({}, before_send({}, {"exc_info": (0, ValueError(), 0)})) diff --git a/authentik/providers/oauth2/tests/test_authorize.py b/authentik/providers/oauth2/tests/test_authorize.py index 6655250d2..828581f36 100644 --- a/authentik/providers/oauth2/tests/test_authorize.py +++ b/authentik/providers/oauth2/tests/test_authorize.py @@ -292,6 +292,7 @@ class TestAuthorize(OAuthTestCase): "component": "ak-stage-autosubmit", "type": ChallengeTypes.NATIVE.value, "url": "http://localhost", + "title": "Redirecting to app...", "attrs": { "access_token": token.access_token, "id_token": provider.encode(token.id_token.to_dict()),