npm @ory/client - Objects being duplicated when calling OAuth2Api.acceptOAuth2ConsentRequest()
Open
Nobody has claimed this yet.
bug
- Dominant language
- PHP
- Stars
- 178
- Forks
- 96
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
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
- Self host Ory Kratos
- Self host Ory Hydra
- Attach object to id_token
- Call OAuth2Api.acceptOAuth2ConsentRequest()
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at OAuth2Api.acceptOAuth2ConsentRequest() in the npm @ory/client SDK and reproduce the call with an object-valued id_token using the configuration shown. Trace where the consent request is serialized and verify the localStorage result; done means the object appears once rather than being duplicated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100