Repository navigation
fix: send the session with Twitch requests - #18
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).APIClientgetshasAccessToken(defaultfalse, so test stubs keep compiling).URLSessionAPIClientanswersaccessTokenProvider() != nil, the same ruleURLSessionLiveChatTransportalready uses for the Twitch chat stream. Guests still make the calls without a token.Why
Reported on Apple TV: Twitch playback shows "Sign in again to continue." although the user is signed in and the Twitch account is linked. These endpoints were built with
APIEndpoint's defaultrequiresAuth: false, so they never sentAuthorization. On an instance with guest access off, the Server answers401 Authentication required(publicAccessOrRespond), whichLiveUserErrormaps to.signInAgain. On instances with guests on,/twitch/liveand/twitch/videosare relayedwithUser, so without the session the linked Twitch account was never used for playback.The shared sources are identical to the iOS app; this is the same commit as TypeType-Video/TypeType-IOS#104 (issue TypeType-Video/TypeType-IOS#103), whose CI (unit tests + build) passed.
Testing
Not built here (no Xcode). The iOS PR with the identical change compiled and passed its unit tests on CI. Not tried on an Apple TV.
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.