From 07ea6f9deeede102256ada4575a920814f357558 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 3 Jan 2024 14:08:55 +0100 Subject: [PATCH] include branding and user in context Signed-off-by: Jens Langhammer --- authentik/stages/authenticator_mobile/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/authentik/stages/authenticator_mobile/models.py b/authentik/stages/authenticator_mobile/models.py index 24d492ae6..288ac180c 100644 --- a/authentik/stages/authenticator_mobile/models.py +++ b/authentik/stages/authenticator_mobile/models.py @@ -172,11 +172,13 @@ class MobileTransaction(ExpiringModel): def send_message(self, request: HttpRequest, **context): """Send mobile message""" - branding = request.tenant.branding_title domain = request.get_host() user: User = self.device.user client_ip = ClientIPMiddleware.get_client_ip(request) + context["_brand"] = request.tenant.branding_title + context["_user"] = user.username + geo = None if GEOIP_CONTEXT_PROCESSOR.configured(): city = GEOIP_CONTEXT_PROCESSOR.city(client_ip) @@ -191,7 +193,7 @@ class MobileTransaction(ExpiringModel): items=self.decision_items, mode=self.device.stage.item_matching_mode, attributes=AuthenticationRequest.Attributes( - title=__("%(brand)s authentication request" % {"brand": branding}), + title=__("Authentication request"), body=__( "%(user)s is attempting to log in to %(domain)s" % {