Add retry to IdP cache lookup (#1882)

This commit is contained in:
pascal-fischer
2024-04-23 19:23:43 +02:00
committed by GitHub
parent 1f33e2e003
commit 8f3a0f2c38
3 changed files with 39 additions and 18 deletions

View File

@@ -374,7 +374,7 @@ func (am *DefaultAccountManager) AddPeer(setupKey, userID string, peer *nbpeer.P
if strings.ToLower(peer.Meta.Hostname) == "iphone" || strings.ToLower(peer.Meta.Hostname) == "ipad" && userID != "" {
if am.idpManager != nil {
userdata, err := am.lookupUserInCache(userID, account)
if err == nil {
if err == nil && userdata != nil {
peer.Meta.Hostname = fmt.Sprintf("%s-%s", peer.Meta.Hostname, strings.Split(userdata.Email, "@")[0])
}
}