Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

Commit

Permalink
Update logix based on pr comment to check on error
Browse files Browse the repository at this point in the history
Signed-off-by: Alistair Hey <[email protected]>
  • Loading branch information
ah-f3 committed Sep 14, 2020
1 parent aa51f48 commit 4ea2e3f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions map_claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ type MapClaims map[string]interface{}
// Compares the aud claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (m MapClaims) VerifyAudience(cmp string, req bool) bool {
aud, _ := m["aud"].([]string)

// special case where aud is a single string not list of strings
if aud == nil {
strAud, _ := m["aud"].(string)
aud, ok := m["aud"].([]string)
if !ok {
strAud, ok := m["aud"].(string)
aud = append(aud, strAud)
if !ok {
return false
}
}

return verifyAud(aud, cmp, req)
Expand Down

0 comments on commit 4ea2e3f

Please sign in to comment.