Disable peer expiration of peers added with setup keys (#758)

This commit is contained in:
Misha Bragin
2023-03-23 17:47:53 +01:00
committed by GitHub
parent 628b497e81
commit e6292e3124
3 changed files with 40 additions and 3 deletions

View File

@@ -358,11 +358,11 @@ func (a *Account) GetNextPeerExpiration() (time.Duration, bool) {
return *nextExpiry, true
}
// GetPeersWithExpiration returns a list of peers that have Peer.LoginExpirationEnabled set to true
// GetPeersWithExpiration returns a list of peers that have Peer.LoginExpirationEnabled set to true and that were added by a user
func (a *Account) GetPeersWithExpiration() []*Peer {
peers := make([]*Peer, 0)
for _, peer := range a.Peers {
if peer.LoginExpirationEnabled {
if peer.LoginExpirationEnabled && peer.AddedWithSSOLogin() {
peers = append(peers, peer)
}
}