fix(auth): find Reddit cookies across all Chrome profiles, not just Default#16
Open
isaintnik wants to merge 1 commit into
Open
fix(auth): find Reddit cookies across all Chrome profiles, not just Default#16isaintnik wants to merge 1 commit into
isaintnik wants to merge 1 commit into
Conversation
…efault browser_cookie3.chrome() reads only the "Default" profile's cookie DB, so `rdt login` finds nothing when the logged-in Reddit session lives in a non-default profile (Profile 1, Profile 2, ...). Multi-profile Chrome users get "No Reddit cookies found" despite an active session. Enumerate every Chrome/Chromium profile cookie DB (Default + "Profile N", across macOS/Linux/Windows paths) and pass each to browser_cookie3 via cookie_file=, selecting the first profile that yields reddit_session. Falls back to Firefox/Edge/Brave as before. Applied to both the uv-subprocess and direct extraction paths. Default is tried first, so single-profile behavior is unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Problem
rdt loginfails with "No Reddit cookies found" for users whose Chrome has more than one profile and who are logged into Reddit in a non-default one.browser_cookie3.chrome(domain_name=".reddit.com")reads only the Default profile's cookie database. When the Reddit session lives inProfile 1/Profile 2/ etc., extraction returns nothing and login fails even though a valid session exists —rdt statusthen reportsauthenticated: false,cookie_count: 0.Fix
Enumerate every Chrome/Chromium profile cookie DB (
DefaultandProfile *, across the standard macOS / Linux / Windows locations) and pass each tobrowser_cookie3.chrome(cookie_file=...), picking the first profile that yieldsreddit_session. Firefox/Edge/Brave remain as fallbacks. Applied to both extraction paths (_extract_subprocessviauv, and_extract_direct).Defaultis tried first, so single-profile / default users see no behavior change.Testing
rdt logout && rdt loginnow authenticates from aProfile 1Reddit session on macOS (Chrome), where it previously found nothing;rdt status→authenticated: truewith the correctusername.123 passed.ruff checkclean.