mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 15:03:09 -06:00
🐛 Remove all 3pids and not just the first one.
This commit is contained in:
parent
193d4ecaa9
commit
d1f3bf502e
|
|
@ -553,10 +553,11 @@ func (a *UserInternalAPI) PerformAccountDeactivation(ctx context.Context, req *a
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = a.DB.RemoveThreePIDAssociation(ctx, threepids[0].Address, threepids[0].Medium)
|
||||
if err != nil {
|
||||
return err
|
||||
for i := 0; i < len(threepids); i++ {
|
||||
err = a.DB.RemoveThreePIDAssociation(ctx, threepids[i].Address, threepids[i].Medium)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
pusherReq := &api.PerformPusherDeletionRequest{
|
||||
|
|
|
|||
|
|
@ -128,6 +128,11 @@ func Test_Accounts(t *testing.T) {
|
|||
_, err = db.GetAccountByPassword(ctx, aliceLocalpart, "newPassword")
|
||||
assert.Error(t, err, "expected an error, got none")
|
||||
|
||||
// This should return an empty slice, as the account is deactivated and the 3pid is unbound
|
||||
threepids, err := db.GetThreePIDsForLocalpart(ctx, aliceLocalpart)
|
||||
assert.NoError(t, err, "failed to get 3pid for account")
|
||||
assert.Equal(t, len(threepids), 0)
|
||||
|
||||
_, err = db.GetAccountByLocalpart(ctx, "unusename")
|
||||
assert.Error(t, err, "expected an error for non existent localpart")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue