mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-11 16:38:27 +01:00
Skip user deletion if the user does not exist in IdP (#1320)
This commit is contained in:
parent
67906f6da5
commit
d78b7e5d93
@ -443,11 +443,18 @@ func (am *DefaultAccountManager) deleteRegularUser(account *Account, initiatorUs
|
||||
}
|
||||
|
||||
if !isNil(am.idpManager) {
|
||||
// Delete if the user already exists in the IdP.Necessary in cases where a user account
|
||||
// was created where a user account was provisioned but the user did not sign in
|
||||
_, err = am.idpManager.GetUserDataByID(targetUserID, idp.AppMetadata{WTAccountID: account.Id})
|
||||
if err == nil {
|
||||
err = am.deleteUserFromIDP(targetUserID, account.Id)
|
||||
if err != nil {
|
||||
log.Debugf("failed to delete user from IDP: %s", targetUserID)
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
log.Debugf("skipped deleting user %s from IDP, error: %v", targetUserID, err)
|
||||
}
|
||||
}
|
||||
|
||||
err = am.deleteUserPeers(initiatorUserID, targetUserID, account)
|
||||
|
Loading…
Reference in New Issue
Block a user