ory / ory/docs

Documentation is wrong for creating JWT

Open
#1,633 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
161
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
Ory Network Project

No response

Describe the bug

https://github.com/ory/docs/blob/2266bc4026d92c854d01d9101afc1b609847eb5d/code-examples/sdk/typescript/src/session/whoami-jwt.ts#L12

I think this is the code backing https://www.ory.sh/docs/identities/session-to-jwt-cors

tokenize_as should be tokenizeAs

and then two lines down should be session.data.tokenized

I would just open a PR with the update but I think maybe someone should go over this as it seems that sessionId is getting passed in for no reason? So maybe there are more issues? Anyhow while I can update it to get it "working" a person with a little bit more knowledge would probably be best looking though it just to make sure everything is up to date.

Thanks!

Reproducing the bug

Follow the documentation found here https://www.ory.sh/docs/identities/session-to-jwt-cors

Relevant log output
none
Relevant configuration
just the ORY network config as describe in the docs in this file.
Version

ory/client@1.5.1

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Ory Network

Additional Context

I'm happy to provide more information, I assumed the docs would mirror the latest cli.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with code-examples/sdk/typescript/src/session/whoami-jwt.ts at the referenced lines and compare it with the identities/session-to-jwt-cors documentation. Verify the tokenizeAs and session.data.tokenized names, and determine whether sessionId is needed. Done means the TypeScript example and published documentation use the current Ory client API and work when followed.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.