Skip to content

Commit

Permalink
fix(ldap/auth): handle nil Auth struct when authentication fails (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper authored Nov 7, 2023
1 parent cc2ce1d commit 669ea15
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ func New(s *Setup) (*Client, error) {
return nil, fmt.Errorf("unable to get user token: %w", err)
}

// vault will return a nil Auth struct with no error if path is correct but password fails
if user.Auth == nil {
return nil, fmt.Errorf("unable to set user token: authentication failed")
}

// set Vault API token in client
vault.SetToken(user.Auth.ClientToken)

Expand Down

0 comments on commit 669ea15

Please sign in to comment.