From 76ac14cb5aae23510cd19a8a6a57ea6a27cd0913 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 5 Oct 2023 20:05:19 +0200 Subject: [PATCH] create app correctly Signed-off-by: Jens Langhammer --- authentik/stages/authenticator_mobile/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/authentik/stages/authenticator_mobile/models.py b/authentik/stages/authenticator_mobile/models.py index a568aed41..7d967344f 100644 --- a/authentik/stages/authenticator_mobile/models.py +++ b/authentik/stages/authenticator_mobile/models.py @@ -127,7 +127,7 @@ class MobileTransaction(ExpiringModel): def send_message(self, request: Optional[HttpRequest], **context): """Send mobile message""" - initialize_app(credentials.Certificate(self.device.stage.firebase_config)) + app = initialize_app(credentials.Certificate(self.device.stage.firebase_config), name=str(self.tx_id)) branding = DEFAULT_TENANT.branding_title domain = "" if request: @@ -160,12 +160,13 @@ class MobileTransaction(ExpiringModel): ), interruption_level="time-sensitive", tx_id=str(self.tx_id), + options=["foo", "bar", "baz"], ), ), token=self.device.firebase_token, ) try: - response = send(message) + response = send(message, app=app) LOGGER.debug("Sent notification", id=response) except (ValueError, FirebaseError) as exc: LOGGER.warning("failed to push", exc=exc)