diff --git a/management/server/peer.go b/management/server/peer.go index c0febc676..07f2629af 100644 --- a/management/server/peer.go +++ b/management/server/peer.go @@ -143,12 +143,6 @@ func (am *DefaultAccountManager) MarkPeerConnected(ctx context.Context, peerPubK return err } - if expired { - // we need to update other peers because when peer login expires all other peers are notified to disconnect from - // the expired one. Here we notify them that connection is now allowed again. - am.UpdateAccountPeers(ctx, accountID) - } - if peer.AddedWithSSOLogin() { if peer.LoginExpirationEnabled && settings.PeerLoginExpirationEnabled { am.checkAndSchedulePeerLoginExpiration(ctx, accountID) @@ -159,6 +153,12 @@ func (am *DefaultAccountManager) MarkPeerConnected(ctx context.Context, peerPubK } } + if expired { + // we need to update other peers because when peer login expires all other peers are notified to disconnect from + // the expired one. Here we notify them that connection is now allowed again. + am.UpdateAccountPeers(ctx, accountID) + } + return nil }