K
Kinde2mo ago
Swapna

When user email is reused and register flow is taken, get error:

json":"{"status": "error", "error_id": "c87fb4035a6c4f76b2c2b9ed892d4d10"}" I have both password connections on : email + passworkd and Username for the same app.
4 Replies
Swapna
SwapnaOP2mo ago
https://thelabletallbuildcompany.kinde.com/end_user_pages/widgets/partials/password/set_password_form Request Method POST Status Code 500 Internal Server Error Remote Address 34.216.239.173:443 Referrer Policy strict-origin-when-cross-origin Let me know if I can provide any more information. thanks!
Nathaly Toledo
Nathaly Toledo2mo ago
Hi Swapna, thanks for reaching out. That 500 error on the password page usually happens when a user tries to register with an email that already exists or when the flow is started from an internal endpoint. Quick things to try now: 1. Start from the hosted page or SDK (sign-in/sign-up or “forgot password”), don’t post to the internal .../widgets/partials/password/set_password_form URL directly. 2. Since your app has Email+password and Username+password enabled, remember they share one password on the same user. If the email already exists, guide the user to Sign in or Reset password instead of registering again. 3. Temporarily disable one password method (keep either Email+password or Username+password) and retry. Let me know if this helps, Thanks
Swapna
SwapnaOP2mo ago
Thank you! yes, thats exactly what is happening. What would be the correct way to deal with this in code? We are using node.js SvelteKit. Looks like we should we add a check if the email exists before initiating the auth? New to Kinde - is there a cde snippet you can point me to?
Nathaly Toledo
Nathaly Toledo2mo ago
Hi,
You don’t need to check if the email exists first.
Just send people through Kinde’s hosted login and pass the email as a hint. Kinde will decide whether to show Sign in (if the account exists) or Create account (if it doesn’t). This also avoids email-guessing issues. SvelteKit example (server action):
// +page.server.ts
import { redirect } from '@sveltejs/kit';

const EMAIL_CONNECTION_ID = process.env.KINDE_EMAIL_CONNECTION_ID!; // e.g. conn_xxx

export const actions = {
continue: async ({ request }) => {
const form = await request.formData();
const email = String(form.get('email') || '').trim();

// Send to Kinde hosted login with a prefilled email
const url =
`/api/auth/login?login_hint=${encodeURIComponent(email)}` +
`&connection_id=${EMAIL_CONNECTION_ID}` +
`&post_login_redirect_url=${encodeURIComponent('/dashboard')}`;

throw redirect(302, url);
}
};
// +page.server.ts
import { redirect } from '@sveltejs/kit';

const EMAIL_CONNECTION_ID = process.env.KINDE_EMAIL_CONNECTION_ID!; // e.g. conn_xxx

export const actions = {
continue: async ({ request }) => {
const form = await request.formData();
const email = String(form.get('email') || '').trim();

// Send to Kinde hosted login with a prefilled email
const url =
`/api/auth/login?login_hint=${encodeURIComponent(email)}` +
`&connection_id=${EMAIL_CONNECTION_ID}` +
`&post_login_redirect_url=${encodeURIComponent('/dashboard')}`;

throw redirect(302, url);
}
};
<!-- +page.svelte -->
<form method="POST">
<input name="email" type="email" placeholder="you@example.com" required />
<button name="continue" value="1">Continue</button>
</form>
<!-- +page.svelte -->
<form method="POST">
<input name="email" type="email" placeholder="you@example.com" required />
<button name="continue" value="1">Continue</button>
</form>
- /api/auth/login is provided by the Kinde SvelteKit SDK. You can pass login_hint, connection_id, and a post_login_redirect_url. - If you’ve enabled both Email + password and Username + password, remember they share one password for the same user. Let me know if this helps, Thanks

Did you find this page helpful?