From daef6e67bcbb913298f7379622f3172def37f5c2 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 16 Sep 2024 17:04:36 +0300 Subject: [PATCH] legacyprovision: don't delete user logins on logout --- cmd/mautrix-meta/legacyprovision.go | 3 ++- pkg/connector/client.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/mautrix-meta/legacyprovision.go b/cmd/mautrix-meta/legacyprovision.go index 5b40d5e..e66c95f 100644 --- a/cmd/mautrix-meta/legacyprovision.go +++ b/cmd/mautrix-meta/legacyprovision.go @@ -95,7 +95,8 @@ func legacyProvLogout(w http.ResponseWriter, r *http.Request) { user := m.Matrix.Provisioning.GetUser(r) logins := user.GetUserLogins() for _, login := range logins { - login.Logout(r.Context()) + // Intentionally don't delete the user login, only disconnect the client + login.Client.(*connector.MetaClient).LogoutRemote(r.Context()) } jsonResponse(w, http.StatusOK, Response{ Success: true, diff --git a/pkg/connector/client.go b/pkg/connector/client.go index c695a40..cb76f17 100644 --- a/pkg/connector/client.go +++ b/pkg/connector/client.go @@ -357,6 +357,7 @@ func (m *MetaClient) LogoutRemote(ctx context.Context) { } } m.resetWADevice() + m.LoginMeta.Cookies = nil } func (m *MetaClient) canReconnect() bool {