cssat / sprout-issues

An issue-only repository for the Sprout data collection platform
https://sproutservices.org
2 stars 1 forks source link

deactivate accounts after 90 days #196

Closed jessicamorris64 closed 1 year ago

jessicamorris64 commented 1 year ago

there is a request to deactivate users (both DCYF and Provider) if they have been inactive for 60 or more days. if they then need to reactivate they can make that request to their Org Admin. this will prevent those who should no longer have access from continuing to have the ability to access Sprout.

alternative if above is not possible: For DCYF staff... CSSAT team provides a monthly report of users inactive for 60 days with DCYF emails.

subaykan commented 1 year ago

Note: we can put a cron in place that executes an update statement like this:

update "Users" set state = 'disabled', "disabledAt" = now() where id in (
    select "userId" from "UserSessions" group by "userId" having "userId" in (
        select id from "Users" where state = 'approved'
    ) and max("createdAt") < now() - interval '60 days'
);

(closed issue #195 as duplicate of this)

subaykan commented 1 year ago

work is done, need to send out a notification to providers

subaykan commented 1 year ago

closing out, this was launched to prod