aboutsummaryrefslogtreecommitdiff
path: root/userapi/internal/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'userapi/internal/api.go')
-rw-r--r--userapi/internal/api.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/userapi/internal/api.go b/userapi/internal/api.go
index 461c548c..ec828439 100644
--- a/userapi/internal/api.go
+++ b/userapi/internal/api.go
@@ -388,3 +388,10 @@ func (a *UserInternalAPI) queryAppServiceToken(ctx context.Context, token, appSe
dev.UserID = appService.SenderLocalpart
return &dev, nil
}
+
+// PerformAccountDeactivation deactivates the user's account, removing all ability for the user to login again.
+func (a *UserInternalAPI) PerformAccountDeactivation(ctx context.Context, req *api.PerformAccountDeactivationRequest, res *api.PerformAccountDeactivationResponse) error {
+ err := a.AccountDB.DeactivateAccount(ctx, req.Localpart)
+ res.AccountDeactivated = err == nil
+ return err
+}