From c3eabb6417f73020d38e6dc410e4a8b4651331c8 Mon Sep 17 00:00:00 2001 From: silentoplayz Date: Mon, 27 Jul 2026 17:32:47 -0400 Subject: [PATCH] feat: emit the auth.login event on SSO logins --- backend/open_webui/utils/oauth.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/open_webui/utils/oauth.py b/backend/open_webui/utils/oauth.py index 0cbfcb2ebf..61cf9a0d17 100644 --- a/backend/open_webui/utils/oauth.py +++ b/backend/open_webui/utils/oauth.py @@ -2050,6 +2050,16 @@ class OAuthManager: **({'max_age': cookie_max_age} if cookie_max_age is not None else {}), ) + await publish_event( + request, + EVENTS.AUTH_LOGIN, + actor=user, + subject_id=user.id, + subject_type='user', + source='oauth', + data={'auth_method': 'oauth', 'provider': provider}, + ) + # Legacy cookies for compatibility with older frontend versions if ENABLE_OAUTH_ID_TOKEN_COOKIE: response.set_cookie(