add nil check for mfa enforcement config namespace on login (#20375)

* add nil check for mfa enforcement config ns

* move nil check and add changelog
This commit is contained in:
davidadeleon 2023-04-26 16:52:39 -04:00 committed by GitHub
parent 5164069708
commit 0d621ea47e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

3
changelog/20375.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
core: prevent panic on login after namespace is deleted that had mfa enforcement
```

View File

@ -1788,7 +1788,8 @@ ECONFIG_LOOP:
if err != nil {
return nil, fmt.Errorf("failed to find the MFAEnforcementConfig namespace")
}
if eConfig == nil || (eConfigNS.ID != ns.ID && !ns.HasParent(eConfigNS)) {
if eConfig == nil || eConfigNS == nil || (eConfigNS.ID != ns.ID && !ns.HasParent(eConfigNS)) {
continue
}