Update peer status when login expires (#688)

Extend PeerStatus with an extra field LoginExpired, that can be stored in the database.
This commit is contained in:
Misha Bragin
2023-02-15 11:27:22 +01:00
committed by GitHub
parent 756ce96da9
commit d31219ba89
5 changed files with 68 additions and 7 deletions
+1 -3
View File
@@ -152,8 +152,6 @@ func toPeerResponse(peer *server.Peer, account *server.Account, dnsDomain string
fqdn = peer.DNSLabel
}
expired, _ := peer.LoginExpired(account.Settings)
return &api.Peer{
Id: peer.ID,
Name: peer.Name,
@@ -170,6 +168,6 @@ func toPeerResponse(peer *server.Peer, account *server.Account, dnsDomain string
DnsLabel: fqdn,
LoginExpirationEnabled: peer.LoginExpirationEnabled,
LastLogin: peer.LastLogin,
LoginExpired: expired,
LoginExpired: peer.Status.LoginExpired,
}
}