mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-09 23:27:43 +02:00
fix querying claim data on the dashboard (#1560)
This commit is contained in:
parent
93c257259e
commit
10b5c5ca0e
5 changed files with 56 additions and 39 deletions
|
@ -69,3 +69,14 @@ func (x *User) AddClaims(claims identity.FlattenedClaims) {
|
|||
x.Claims[k] = svs
|
||||
}
|
||||
}
|
||||
|
||||
// GetClaim returns a claim.
|
||||
//
|
||||
// This method is used by the dashboard template HTML to display claim data.
|
||||
func (x *User) GetClaim(claim string) []interface{} {
|
||||
var vs []interface{}
|
||||
for _, sv := range x.GetClaims()[claim].GetValues() {
|
||||
vs = append(vs, sv.AsInterface())
|
||||
}
|
||||
return vs
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue