Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin user first login time is always = last login time #407

Open
aeberhart opened this issue Aug 9, 2024 · 1 comment
Open

admin user first login time is always = last login time #407

aeberhart opened this issue Aug 9, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@aeberhart
Copy link
Contributor

aeberhart commented Aug 9, 2024

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

@aeberhart aeberhart added the bug Something isn't working label Aug 9, 2024
@aeberhart aeberhart added this to the 5.3 milestone Aug 9, 2024
@aeberhart aeberhart self-assigned this Aug 9, 2024
@aeberhart
Copy link
Contributor Author

solution would be to move "firstlogin":$now() from on-login to the on-create trigger

@aeberhart aeberhart modified the milestones: 5.3, backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant