Skip to content

fix: send the session with Twitch requests - #104

Merged
Priveetee merged 3 commits into
devfrom
fix/twitch-session-token
Nov 25, 2026
Merged

Priveetee merged 3 commits into
devfrom
fix/twitch-session-token

Conversation

@Toastienergy

Copy link
Copy Markdown
Collaborator

Fixes #103.

What

Twitch requests that guests may also make now send the session token when the user is signed in:

  • LiveTwitchService: lives, past broadcasts, chapters, clips, browse lists, search.
  • LiveTwitchAccountService: chat assets, chat highlights, past-broadcast chat (/twitch/videos/{id}/comments).

APIClient gets hasAccessToken (default false, so test stubs keep compiling). URLSessionAPIClient answers accessTokenProvider() != nil. This is the same rule URLSessionLiveChatTransport already uses for the Twitch chat stream (requiresAuth: client.accessTokenProvider() != nil). Guests still make the calls without a token.

Why

These endpoints were built with APIEndpoint's default requiresAuth: false, so they never sent Authorization. On an instance with guest access off, the Server answers 401 Authentication required and the app shows "Sign in again to continue." for every live, VOD and clip, even though the user is signed in. On instances with guests on, /twitch/live and /twitch/videos are relayed withUser, so without the session the linked Twitch account was never used for playback (subscriber-only content, ad-free playback). Details in #103.

Testing

Not built or run: written without Xcode. CI should compile it. Not tried on a device; the reporter will check on their instance (guest access off).

To check by hand: instance with guest access off, sign in, link Twitch, then open a live, a VOD (with chat) and a clip.


AI disclosure: this change was written with an AI coding assistant (Claude via Hermes Agent) at the reporter's request.

@Priveetee
Priveetee merged commit 19a7b8d into dev Nov 25, 2026
2 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.

Bug: Twitch playback says "Sign in again to continue." although signed in (Twitch requests are sent without the session token)

2 participants