From 51e4623214a23691e36bf241e8f8a8eaece97593 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 8 Sep 2023 19:24:20 +0200 Subject: [PATCH] lazy import firebase Signed-off-by: Jens Langhammer --- authentik/stages/authenticator_mobile/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/authentik/stages/authenticator_mobile/models.py b/authentik/stages/authenticator_mobile/models.py index 523222d11..019344392 100644 --- a/authentik/stages/authenticator_mobile/models.py +++ b/authentik/stages/authenticator_mobile/models.py @@ -32,9 +32,6 @@ from authentik.lib.models import SerializerModel from authentik.stages.authenticator.models import Device from authentik.tenants.utils import DEFAULT_TENANT -cred = credentials.Certificate("firebase.json") -initialize_app(cred) - LOGGER = get_logger() @@ -128,6 +125,8 @@ class MobileTransaction(ExpiringModel): def send_message(self, request: Optional[HttpRequest], **context): """Send mobile message""" + cred = credentials.Certificate("firebase.json") + initialize_app(cred) branding = DEFAULT_TENANT.branding_title domain = "" if request: