Skip to content

Fix current billing authentication and add portable cookie login helper - #17

Open
vuongnmhvn wants to merge 1 commit into
paperfoot:mainfrom
vuongnmhvn:codex/portable-cookie-login
Open

vuongnmhvn wants to merge 1 commit into
paperfoot:mainfrom
vuongnmhvn:codex/portable-cookie-login

Conversation

@vuongnmhvn

Copy link
Copy Markdown

Problem

With Suno's current billing response, cookie authentication can complete the Clerk token exchange and then fail while verifying the account with error decoding response body. The response now uses subscription_type and a plans catalogue; the CLI expected a legacy plan object. This was reproduced on a free account.

Change

  • Accept both billing shapes and resolve the displayed plan from the current catalogue, while keeping total_credits_left required so malformed responses do not silently appear as zero credits.
  • Identify the failed response and JSON schema error without printing response bodies that might contain secrets. Align the Clerk HTTP client user agent with the API client.
  • Add a portable English scripts/suno-auth-cookie.sh helper for environments where browser extraction fails. It reads __client without echoing it and passes it through stdin, with optional SUNO_BIN selection and global installation instructions.

Validation

  • cargo test --locked — all 196 tests passed.
  • cargo fmt --check and cargo build --release --locked passed.
  • PTY smoke test confirmed hidden input, stdin delivery, CLI flags and success handling.
  • Read-only live check: suno --no-browser credits succeeded for a Free Plan account with 100 credits. No music was generated.

The billing compatibility portion overlaps the intent of #4, #7 and #11; this PR also includes the cookie login helper and safe decode diagnostics.

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.

1 participant