Skip to content

Commit

Permalink
add nil check for mfa enforcement config namespace on login (hashicor…
Browse files Browse the repository at this point in the history
…p#20375)

* add nil check for mfa enforcement config ns

* move nil check and add changelog
  • Loading branch information
davidadeleon authored Apr 26, 2023
1 parent d766848 commit c261445
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/20375.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
core: prevent panic on login after namespace is deleted that had mfa enforcement
```
3 changes: 2 additions & 1 deletion vault/login_mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit c261445

Please sign in to comment.