platform
platform copied to clipboard
admin user first login time is always = last login time
in the on-login expression we run
$upsert("config", "user", {"ID":email, "name":user, "firstlogin":$now(), "lastlogin":$now()});
both first and last login are set to now
also, there's a table update trigger:
'admin' in $djRoles() ? false :
{
'setObject': object ~> | $ | {'lastlogin': $now()}, ['firstlogin', 'name'] |
}
that basically disallows non admins to change first and last login
solution would be to move "firstlogin":$now() from on-login to the on-create trigger
not really that important