fix: improve example & fix userinfo marshal (#132)
* fix: example client should track state, call cli.CodeFlow need context * fix: oidc userinfo can UnmarshalJSON with address * rp Discover use client.Discover * add instruction for example to README.md
This commit is contained in:
parent
a63fbee93d
commit
ff2c164057
6 changed files with 48 additions and 7 deletions
|
@ -360,6 +360,7 @@ func (i *userinfo) MarshalJSON() ([]byte, error) {
|
|||
func (i *userinfo) UnmarshalJSON(data []byte) error {
|
||||
type Alias userinfo
|
||||
a := &struct {
|
||||
Address *userInfoAddress `json:"address,omitempty"`
|
||||
*Alias
|
||||
UpdatedAt int64 `json:"update_at,omitempty"`
|
||||
}{
|
||||
|
@ -368,7 +369,7 @@ func (i *userinfo) UnmarshalJSON(data []byte) error {
|
|||
if err := json.Unmarshal(data, &a); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
i.Address = a.Address
|
||||
i.UpdatedAt = Time(time.Unix(a.UpdatedAt, 0).UTC())
|
||||
|
||||
if err := json.Unmarshal(data, &i.claims); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue