https://supertokens.com/ logo
l

LouieMartin

05/28/2022, 5:49 AM
Can I Sign up a user with like a function that takes parameters for username, password, email, ect... ex:
Copy code
ts
signUp({
  username: 'LouieMartin',
  password: '123123',
});
r

rp

05/28/2022, 5:49 AM
hey!
yea. technically, you can.
l

LouieMartin

05/28/2022, 5:49 AM
Hello, you responded fast today.
r

rp

05/28/2022, 5:50 AM
well, i was online haha
am*
l

LouieMartin

05/28/2022, 5:50 AM
he
so how do you achieve this?
r

rp

05/28/2022, 5:51 AM
if you use a username, keep in mind about a few things: - the user object that is returned will still have an email field. The value of this will be the username. - When sending reset password emails, it will by default try and send it to the username (and fail). So you will need to provide the callback to send the reset password email yourself (same goes for email verification if that is enabled)
l

LouieMartin

05/28/2022, 5:51 AM
ok
r

rp

05/28/2022, 5:52 AM
> so how do you achieve this? Do you want to call this in your own API or change our default ones to allow for username?
l

LouieMartin

05/28/2022, 5:52 AM
so I can set the username
usually it just sets the email
r

rp

05/28/2022, 5:53 AM
so in the form, you have the email and the username as the input?
l

LouieMartin

05/28/2022, 5:54 AM
yes
r

rp

05/28/2022, 5:55 AM
right. Which recipe are you using?
l

LouieMartin

05/28/2022, 5:56 AM
ThirdPartyEmailPassword Recipe
how do I add a username input
l

LouieMartin

05/28/2022, 5:57 AM
oh nice
r

rp

05/28/2022, 5:57 AM
You can add validators to the username input as well to make sure that it is unique
2 Views