prevent panic on mfa enforcement delete after a namespace is deleted (#18923)

* prevent panic on mfa enforcement delete after a namespace is deleted

* CL
This commit is contained in:
Hamid Ghaf 2023-01-31 16:06:16 -05:00 committed by GitHub
parent 881ae5a303
commit 9c8fcaf5a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

3
changelog/18923.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
core: prevent panic in login mfa enforcement delete after enforcement's namespace is deleted
```

View File

@ -2700,6 +2700,10 @@ func (b *LoginMFABackend) deleteMFALoginEnforcementConfigByNameAndNamespace(ctx
return err
}
if eConfig == nil {
return nil
}
entryIndex := mfaLoginEnforcementPrefix + eConfig.ID
barrierView, err := b.Core.barrierViewForNamespace(eConfig.NamespaceID)
if err != nil {