Deactivating an account works but trying to reactivate an account does not.
As far as I can tell from synapse code there is no handler for account reactivation.
https://github.com/matrix-org/synapse/blob/master/synapse/rest/admin/users.py#L229
If this is not implemented, wouldn't it be good to point it out in docs? https://github.com/matrix-org/synapse/blob/master/docs/admin_api/user_admin_api.rst
Homeserver: 1.12.3+bionic1
Install method: apt
Platform: ubuntu 18.04
AFAIK it is not implemented.
I don't believe this is implemented, the API should probably reject attempting to set deactivated to False if the account has previously been deactivated.
I agree that the documentation could be clearer here, I'm unsure how difficult it would be to implement reactivating of accounts.
Would this be possible via some psql command?
Would this be possible via some
psqlcommand?
Probably. From the top of my head, reactivating an account should only need to update the user's row in the users table, by switching deactivated to false and setting a password. Bear in mind, though, that the deactivation process in Synapse makes the user leave every room they're in and unbind the 3PIDs they had bound, and reactivating won't magically undo that.
For the upcoming swing at this work it's only necessary to allow the user to log in with their previously-deactivated username - there's no need to try and restore all of their old room memberships.
In fact it could be important to not access previous data, if some company decides to recycle usernames in ldap/SSO.
How do I use the reactivation feature for my Matrix account?
How do I use the reactivation feature for my Matrix account?
An administrator would need to use the admin API to re-activate the account. This also isn't released yet, but will be in the next version of Synapse.
@clokep When the admin reactivate the account, it will not be removed from database table erased_users? Is this on purpose?
@dklimpel No, that is not on purpose. Looks like that was missed when implementing it. I'll take a look!
See #7908 for a follow-up.
Most helpful comment
For the upcoming swing at this work it's only necessary to allow the user to log in with their previously-deactivated username - there's no need to try and restore all of their old room memberships.