Skip to content

Fix : Render provider (support OAuth + new GraphQL behavior)#344

Closed
Oscar-Quiloulou wants to merge 1 commit into
kaifcodec:mainfrom
Oscar-Quiloulou:main
Closed

Fix : Render provider (support OAuth + new GraphQL behavior)#344
Oscar-Quiloulou wants to merge 1 commit into
kaifcodec:mainfrom
Oscar-Quiloulou:main

Conversation

@Oscar-Quiloulou
Copy link
Copy Markdown

🛠️ Summary

This PR updates the Render provider to support both classic email‑password accounts and OAuth‑based accounts (GitHub / Google), following Render’s recent GraphQL changes.

Render removed all legacy validation mutations and now exposes only the signUp mutation. This mutation always returns a GraphQL error, but the error message contains a JSON payload that reveals the actual email state.

This patch restores correct behavior for detecting:

  • existing emails (classic accounts)

  • existing emails (OAuth accounts)

  • available emails

It also adds the internal x-render-client-* headers required by Render’s new API.

🔍 Background

Render recently changed its GraphQL API:

  • all legacy mutations (validateEmail, checkEmail, validateSignup) were removed

  • signUp is now the only mutation that exposes email existence

  • signUp always returns an error, but the error message contains structured JSON

  • OAuth accounts (GitHub/Google) are not stored in the same table as classic accounts

  • therefore, OAuth emails return "email":"invalid" even though they exist

Render’s current behavior returns one of the following payloads inside the GraphQL error:

json
{"email": "exists"}
json
{"email": "invalid"}
json
{"hcaptcha_token": "invalid"}

These correspond to:

Payload | Meaning | Interpretation -- | -- | -- {"email":"exists"} | Classic Render account | taken {"email":"invalid"} | OAuth account or unknown | taken {"hcaptcha_token":"invalid"} | Valid but unused email | available

🔧 Changes

  • replaced all deprecated mutations with signUp

  • added required x-render-client-* headers

  • parsed JSON error payloads returned by Render

  • treated OAuth accounts ("email":"invalid") as taken

  • improved compatibility with Render’s current API

💡 Why this matters

Before this patch, the Render provider always failed with:

Code
GraphQL validation failed

or incorrectly marked OAuth accounts as invalid.

With this fix, the provider correctly detects:

  • classic accounts

  • OAuth accounts

  • available emails

and is fully functional again.

🧪 Testing

Tested against:

  • classic Render accounts

  • OAuth GitHub accounts

  • non‑existent emails

  • random valid emails

All cases return the correct result.

… GraphQL behavior

Render removed all legacy email validation mutations (validateEmail, checkEmail,
validateSignup). The only remaining mutation is `signUp`, which returns structured
errors indicating the email state.

This patch updates the provider to use `signUp` and correctly interpret all
possible responses:

- {"email":"exists"} → classic Render account (email+password)
- {"email":"invalid"} → OAuth-only account (GitHub/Google) → treat as taken
- {"hcaptcha_token":"invalid"} → valid but unused email → available

Also adds required x-render-client-* headers to avoid GraphQL validation errors.

This makes the Render provider fully functional again and compatible with both
classic and OAuth-based accounts.
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