feat: emit auth.login on SSO logins and attribute SSO logouts (#27619)

* feat: emit the auth.login event on SSO logins

* feat: attribute SSO logouts in the auth.logout event payload
This commit is contained in:
G30
2026-08-17 02:22:25 -06:00
committed by GitHub
parent a3a81fee03
commit 88c55b86b1
2 changed files with 14 additions and 3 deletions
+10
View File
@@ -2162,6 +2162,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(