Skip to content

chore(monitoring): add triggers for login#37

Merged
stackhousesrl merged 2 commits intoflowerforce:mainfrom
FilippoDeiana:feature/trigger-login
Mar 11, 2026
Merged

chore(monitoring): add triggers for login#37
stackhousesrl merged 2 commits intoflowerforce:mainfrom
FilippoDeiana:feature/trigger-login

Conversation

@FilippoDeiana
Copy link
Contributor

Description

Add support for authentication login triggers (operation_type: "LOGIN") so trigger functions can run on successful login events, including provider-filtered login triggers.

List of proposed changes

  • Added LOGIN to supported authentication trigger operation types.
  • Extended authentication trigger runtime handling to process LOGIN events and execute configured trigger functions.
  • Updated auth providers to persist lastLoginAt on successful login so login events can be detected:
    • local-userpass login updates auth_users.lastLoginAt
    • custom-function login updates auth_users.lastLoginAt
    • anon-user login inserts users with lastLoginAt
  • Added new e2e trigger configs:
    • authLoginTrigger.json
    • authProviderLoginLocalTrigger.json
    • authProviderLoginAnonTrigger.json
  • Added new e2e function onLoginUser and registered it in function config.
  • Added e2e coverage for:
    • generic login trigger firing
    • provider-filtered login trigger for local-userpass
    • provider-filtered login trigger for anon-user
  • Updated two existing creation-trigger assertions to wait by event type (on_user_creation) to avoid ambiguity once login events are also emitted.

How to test the changes

  1. After a successful login, verify:
  • auth_users.lastLoginAt is set
  • triggerEvents contains type: "on_user_login"
  • providerTriggerEvents contains:
    • auth_provider_login_local-userpass for local-userpass
    • auth_provider_login_anon-user for anon-user

Modified packages

  • flowerbase
  • demo

@stackhousesrl stackhousesrl merged commit e84f02f into flowerforce:main Mar 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants