K
Kinde2mo ago
kisonay

Custom Sign Up From Not Working As Expected

I've created a custom sign in form, and that works well, it collects an email and redirect to enter the OTP. I'm having trouble doing the same with sign up form. I'm using this code to invoke the sign up:
const { register } = useKindeAuth();
register({
authUrlParams: {
login_hint: username,
connection_id: "conn_xxxx",
},
})
const { register } = useKindeAuth();
register({
authUrlParams: {
login_hint: username,
connection_id: "conn_xxxx",
},
})
When the form is submitted, I'm brought to a page that indicates that a OTP was sent to the username, not the screen that requests that an email be entered. Am I missing something?
9 Replies
kisonay
kisonayOP2mo ago
I've confirmd that conn_xxxx is the correct one for the username + code authentication method and it is enabled for the application.
IkiTg07
IkiTg072mo ago
If you pass a username to the login_hint it will redirects you to the page for the OTP that's normal
kisonay
kisonayOP2mo ago
Thanks @IkiTg07 i've reviewed this page a few times. As far as I can tell, all of the examples on that page are for sign in. I'm trying to register a user with a custom form.
IkiTg07
IkiTg072mo ago
Well i do have custom sign in and sign up. I'm using them with email tho but I still think it's applicable. When i register a user they are redirected to a page for the OTP because they have to do it to confirm their identity (email in my case)
IkiTg07
IkiTg072mo ago
Check here https://docs.kinde.com/authenticate/authentication-methods/username-authentication/?r=search#_top "On sign-up or registration, the user will need to do a one-time validation of their identity via email - for security - but they can subsequently use a username to sign in."
Kinde docs
Username authentication
Our developer tools provide everything you need to get started with Kinde.
kisonay
kisonayOP2mo ago
Yes, I agree that is what the docs say, but what I experience is, when using register() as shown above, I'm brought to a one time password screen, for an account that doesn't exist for the username I passed to it. does that mean I must use an email and not username?
Claire_Kinde
Claire_Kinde2mo ago
All users must have an email as part of their identity. We support username sign in/sign up, but only after an initial account verification via email. Some additional info in this doc https://docs.kinde.com/authenticate/authentication-methods/username-authentication/?r=search#why-an-email-is-required
kisonay
kisonayOP2mo ago
thank you @Claire_Kinde, this does make sense. I'll do some testing and see how it works. I just assumed that if I started with the email, they wouldn't be prompted to enter a username.
Want results from more Discord servers?
Add your server