I’m wondering if App logins are logged or it it is possible to log them?
I thought I could log appusers logging in by adding an event to the login button which would update a field called “Login Date” in the user’s table. However, it seems that the login button can’t draw from a data source other than the user fields “Is Authenticated”, “ID”, “Email”, “Username” or “Role”. So I can’t for example use a source field “today” to update the row.
Is there any in-app way to do this? I suppose I could trigger a webhook, then involve an external app like n8n - but that sounds like a hard way to do something simple.
I think the underlying issue here is that a data source loads data on page load and the filtering for this data source would require a user id parameter which it would only have after a user logs in.
I think there are many aspects the team could explore to solve for this. I will bring it up internally!
For now - I have changed your topic to a feature request.
I did find a way that may work for you though.
Create a new Last modified field in your users table.
Add an update row event on the login element and simply set the email field to be User > Email (this will overwrite the record with the same value and the Last modified will be updated on this event.
Thanks. That’s a good work-around. I did already have a “last modified field” to log when the user was actually modified (eg changed their password), but I think I need a “Last logged in” field more, so I’ll convert it using your clever work-around.