Skip to content

docs(auth): escape session storage before embedding in init script - #42477

Merged
Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
lazerg:docs-42476
Sep 1, 2026
Merged

docs(auth): escape session storage before embedding in init script#42477
Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
lazerg:docs-42476

Conversation

@lazerg

Copy link
Copy Markdown

The Java, Python and C# session storage examples concatenate the stored JSON straight into a single-quoted JavaScript string literal. When a session value is itself a JSON string, as it is with oidc-client-ts, its \" escapes are consumed by the JavaScript string literal, so JSON.parse(storage) gets unescaped quotes and throws. A single quote in any value breaks the snippet the same way.

Escape backslashes and single quotes before the concatenation.

Fixes #42476

@lazerg Lazizbek Ergashev (lazerg) changed the title docs(auth): escape session storage before embedding it in the init script docs(auth): escape session storage before embedding in init script Aug 31, 2026

@dgozman Dmitry Gozman (dgozman) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

@dgozman
Dmitry Gozman (dgozman) merged commit 4810881 into microsoft:main Sep 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double-encoding needed on sessionState

2 participants