Skip to content

fix(jellyfin): persist session on password login - #3

Merged
selmant merged 3 commits into
selmant:developfrom
arqueon:agent/persist-jellyfin-session-on-login
Aug 13, 2026
Merged

fix(jellyfin): persist session on password login#3
selmant merged 3 commits into
selmant:developfrom
arqueon:agent/persist-jellyfin-session-on-login

Conversation

@arqueon

@arqueon arqueon commented Aug 12, 2026

Copy link
Copy Markdown

Description

Password-based Jellyfin and Emby login authenticated existing users successfully but discarded the personal access token returned by the media server. The global server integration continued to work, while user-scoped features such as Continue Watching treated the account as unlinked. The owner account made this particularly difficult to recover from because it cannot unlink its primary media-server identity in the UI.

This change persists the returned access token and device ID for an existing user, matching the behavior already implemented by Quick Connect. It also stores the access token when password login creates a new imported user. A regression test covers an existing Jellyfin user with a missing personal session.

AI Disclosure: Codex was used to diagnose the production behavior, inspect the relevant authentication paths, generate the initial code and regression test, run validation, and draft the PR text and responses. I reviewed the change, its focused scope, the test results, and the contribution requirements before approving submission.

How Has This Been Tested?

Tested with the repository's declared Node.js 24 runtime and pnpm 10.24.0:

  • pnpm test server/routes/auth.test.ts — 48 tests passed
  • pnpm typecheck:server
  • pnpm exec eslint server/routes/auth.ts server/routes/auth.test.ts
  • pnpm exec prettier --check server/routes/auth.ts server/routes/auth.test.ts
  • pnpm build
  • git diff --check

The regression test authenticates an existing Jellyfin user whose personal token is absent, then verifies that the returned token and the selected device ID are persisted.

Screenshots / Logs (if applicable)

Not applicable; this is a server-side authentication persistence fix with no UI changes.

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly. (No user-facing documentation changes are required.)
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract (Not applicable; no UI strings changed.)
  • Database migration (if required) (Not applicable; no schema changes.)

@selmant

selmant commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Looks good from my side. Any reason this is still in draft? If there's nothing else planned, feel free to mark it ready for review.

@arqueon
arqueon marked this pull request as ready for review August 13, 2026 12:50
@arqueon
arqueon requested a review from selmant as a code owner August 13, 2026 12:50
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@selmant
selmant merged commit aa263c6 into selmant:develop Aug 13, 2026
14 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.

2 participants