Skip to content

Fix dynamic App Store auth endpoint discovery#493

Open
tosbaha wants to merge 1 commit into
majd:mainfrom
tosbaha:fix/auth-endpoint
Open

Fix dynamic App Store auth endpoint discovery#493
tosbaha wants to merge 1 commit into
majd:mainfrom
tosbaha:fix/auth-endpoint

Conversation

@tosbaha

@tosbaha tosbaha commented Jun 10, 2026

Copy link
Copy Markdown

It seems the App Store auth endpoint doesn't work. I tested end-to-end, and it worked for my old account, which doesn't have 2FA.

Disclaimer: Most of the code is written by AI, and I am putting it here so that maybe it can help you to solve this issue faster.


Summary by cubic

Fixes dynamic App Store auth endpoint discovery and normalization to keep login working when Apple changes URLs. We now default to the native /fast/ endpoint and retry login when a new endpoint is found in responses.

  • Bug Fixes
    • Read authenticateAccount from the bag root or urlBag, normalize it, and fallback to https://auth.itunes.apple.com/auth/v1/native/fast/.
    • During login, normalize the provided endpoint; on decode errors, extract an auth URL from the response and retry with the discovered endpoint.
    • Added ResponseDecodeError in pkg/http to capture status, content type, a trimmed body, and extracted URLs for discovery.
    • Introduced endpoint helpers in pkg/appstore (normalizeAuthEndpoint, etc.) and added tests covering bag, login retry, and normalization.

Written for commit a98f833. Summary will update on new commits.

Review in cubic

@ZomkaDEV

Copy link
Copy Markdown

What are the difference between this PR and this one? #490

@tosbaha

tosbaha commented Jun 10, 2026

Copy link
Copy Markdown
Author

@ZomkaDEV I first tried their PR and it didn't work for me. I asked AI to fix it and my version worked.

@pmalecka

Copy link
Copy Markdown

This one works well, thanks!

@viktorkuts

Copy link
Copy Markdown

Can vouch for this PR, worked for me as well, lifesaver, many thanks!

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.

5 participants