Skip to content

Fix login for accounts without 2FA - #455

Merged
kabiroberai merged 5 commits into
xtool-org:mainfrom
nab138:main
Nov 23, 2026
Merged

kabiroberai merged 5 commits into
xtool-org:mainfrom
nab138:main

Conversation

@nab138

@nab138 nab138 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes login for free apple accounts with no 2FA method (i.e. burner accounts created on music.apple.com). For these accounts, GSA says "repair," since they want you to add a 2FA method, but you can just ignore it and proceed as normal.

How was it tested?

Ran locally on linux and logged in with my burner. I can test on macOS if needed.

AI tool usage

How much of the code in this PR was AI-assisted? (check one)

  • 0 - No AI was used to write code
  • 1 - I was assisted by AI in writing code. I reviewed the finished result.
  • 2 - I set the AI going and left it to it; nobody has read the result - no review, or AI review only

Summary by CodeRabbit

  • Authentication
    • Sign-in now recognizes repair-mode authentication responses and continues without prompting for the standard two-factor authentication step.
    • Other authentication responses that require two-factor verification continue through the existing verification flow.
    • Retry behavior for failed secondary authentication remains unchanged, and other supported two-factor modes continue to work as before during sign-in.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The authentication mode enum adds repair. When a 409 response uses this mode, authentication returns loginData, and the two-factor operation exits without performing two-factor authentication.

Changes: Authentication flow

Layer / File(s) Summary
Repair-mode authentication handling
Sources/XKit/GrandSlam/Model/GrandSlamAuthEndpoint.swift, Sources/XKit/GrandSlam/Operations/GrandSlamAuthenticateOperation.swift, Sources/XKit/GrandSlam/Operations/GrandSlamTwoFactorAuthenticateOperation.swift
The authentication mode enum adds repair. For this mode, the authentication operation returns loginData, and the two-factor operation returns without performing two-factor authentication.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: kabiroberai

Merge Risk: Minimal · up to a8127

This change lets accounts without two-factor authentication proceed through login when the server requests a repair step. The change is small and contained, and no concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Fix login for accounts without 2FA" matches the main change. The PR adds a "repair" authentication mode. When GSA returns status 409 with mode ".repair", authenticate returns loginData with…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Fix login for accounts without 2FA" matches the main change. The PR adds a "repair" authentication mode. When GSA returns status 409 with mode ".repair", authenticate returns loginData without running the two-factor flow. This lets free Apple accounts without a 2FA method log in. The title is specific and concise and describes the primary behavior change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9a596292-6e20-47e2-b317-71bf32ca5a9b
Commits

Reviewing files that changed from the base of the PR and between 964a1c9 and a812796.

Files selected for processing: 2

  • Sources/XKit/GrandSlam/Model/GrandSlamAuthEndpoint.swift
  • Sources/XKit/GrandSlam/Operations/GrandSlamTwoFactorAuthenticateOperation.swift
Files skipped from review as they are similar to previous changes: 2

  • Sources/XKit/GrandSlam/Model/GrandSlamAuthEndpoint.swift
  • Sources/XKit/GrandSlam/Operations/GrandSlamTwoFactorAuthenticateOperation.swift

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@kabiroberai kabiroberai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@kabiroberai
kabiroberai enabled auto-merge (squash) November 23, 2026 15:33
@kabiroberai
kabiroberai merged commit ac20d0c into xtool-org:main Nov 23, 2026
8 of 11 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