Retrieve second last login moment

0
I'm trying to make a security check, based on the last and the second last login moment. On the User entity there's a LastLogin attribute, but directly after logging in, it is changed to current date and time. Is there a way to save this LastLogin date before a user actually logs in? Ideal would be a trigger on System.User, but this is not possible.
asked
2 answers
0

I guess you're actually creating Administration.Account entities for users? In that way you can set events on that entity.

answered
0

You're right, I do.

I tried an event on Account, but the event won't fire if attribute Account.LastLogin changes. This is quite counter-intuitive, as indeed Account is a generalization of User and you can use or change this attribute via Account.

I built a custom logon form, activated Anonymous users, and used a microflow to save the current time in a new table 'Logins'. Thus I could keep track of every login.

Via a microflow, I can retrieve the second last login time now. But I think it is pretty cumbersome to do it this way.

answered