ory / sdk

The place where ORY's SDKs are being auto-generated
Apache License 2.0
135 stars 85 forks source link

npm @ory/client - Objects being duplicated when calling OAuth2Api.acceptOAuth2ConsentRequest() #321

Open dannycarrera opened 5 months ago

dannycarrera commented 5 months ago

Preflight checklist

Ory Network Project

No response

Describe the bug

When assigning an object (such as name) to id_token and calling OAuth2Api.acceptOAuth2ConsentRequest(), the resulting localStorage value is duplicated.

Reproducing the bug

  1. Self host Ory Kratos
  2. Self host Ory Hydra
  3. Attach object to id_token
  4. Call OAuth2Api.acceptOAuth2ConsentRequest()
  5. Inspect localStorage in the browser

Relevant log output

{  
    "profile": {
        "name": [
            {
                "first": "John",
                "last": "Doe"
            },
            {
                "first": "John",
                "last": "Doe"
            }
        ],
    },
}

Relevant configuration

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Person",
    "type": "object",
    "properties": {
      "traits": {
        "type": "object",
        "properties": {
          "name":{
            "type":"object",
            "properties": {
              "first": {
                "type":"string",
                "title":"Your first name",
                "minLength": 1,
                "maxLength": 32
              },
              "last": {
                "type":"string",
                "title":"Your last name",
                "minLength": 1,
                "maxLength": 32
              }
            },
            "required": ["first","last"]
          }
        },
        "required": ["name"]
      }
    },
    "additionalProperties": false
  }

Version

1.5.2

On which operating system are you observing this issue?

Windows

In which environment are you deploying?

Binary

Additional Context

No response