`@keystone-6/auth` assumes a non-zero `itemId`

Open
#8,843 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
38/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
nodejs, typescript

Research direction

Open packages/auth/src/index.ts at the linked check around line 173 and trace how session.itemId is handled. Verify the behavior for a user whose autoincremented ID is 0; done means that itemId value is accepted without breaking the existing session handling.

Written by the indexing model from the issue text.

Description

https://github.com/keystonejs/keystone/blob/60357b76c6eac1c3727b8cb77059e8d7908b92aa/packages/auth/src/index.ts#L173

I had a user with ID===0 where the field was autoincrement. Can we support this use case?
This check should either be "itemId" in session or !session.itemId && session.itemId !== 0)

Dominant language
TypeScript
Stars
10k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
38

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from keystonejs/keystone

All issues in keystonejs/keystone

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.