Is it okay to only have sign in option and no sign up in next-auth?
Answered
Loggerhead Shrike posted this in #help-forum
Loggerhead ShrikeOP
I am learning and creating user authentication using Nextjs, I've learned to create sign in using Google.
This is what I'm planning to do, I'll just have sign in option. Then store and send data if a user with a specific google account added or edited anything with thier account. THen showing them with their edits next time they sign in.
I mean no sign up, just sign in function only. Is it a good way to do it or I need to create sign up seperately?
I apologise if this is unclear, I'll tell you in more detail if you need more explanation. Thank you
This is what I'm planning to do, I'll just have sign in option. Then store and send data if a user with a specific google account added or edited anything with thier account. THen showing them with their edits next time they sign in.
I mean no sign up, just sign in function only. Is it a good way to do it or I need to create sign up seperately?
I apologise if this is unclear, I'll tell you in more detail if you need more explanation. Thank you
Answered by Anay-208
You can just create 1 button for it, and check in the server actions whether user is signed up or not. But keep in mind you'll have to ask for additional fields if google doesn't provide it
6 Replies
@Loggerhead Shrike I am learning and creating user authentication using Nextjs, I've learned to create sign in using Google.
This is what I'm planning to do, I'll just have sign in option. Then store and send data if a user with a specific google account added or edited anything with thier account. THen showing them with their edits next time they sign in.
I mean no sign up, just sign in function only. Is it a good way to do it or I need to create sign up seperately?
I apologise if this is unclear, I'll tell you in more detail if you need more explanation. Thank you
What I have done in a project is that I have 1 path for both signin and signup, and if user isn't registered, it registers the user, otherwise signs the user in
@Anay-208 What I have done in a project is that I have 1 path for both signin and signup, and if user isn't registered, it registers the user, otherwise signs the user in
Loggerhead ShrikeOP
Thank you very much. So should I do like this:
Create two button, sign up and sign in (both using google account)
If user click on sign up and choose an account, we will check it user exist or not and then create new user for that account
if they click sign in, we will check if we are already have that google account in our mongodb or not and then show them their existing one if it exist right?
But then both sign in and sign up will have same code isn't it?
Create two button, sign up and sign in (both using google account)
If user click on sign up and choose an account, we will check it user exist or not and then create new user for that account
if they click sign in, we will check if we are already have that google account in our mongodb or not and then show them their existing one if it exist right?
But then both sign in and sign up will have same code isn't it?
@Loggerhead Shrike Thank you very much. So should I do like this:
Create two button, sign up and sign in (both using google account)
If user click on sign up and choose an account, we will check it user exist or not and then create new user for that account
if they click sign in, we will check if we are already have that google account in our mongodb or not and then show them their existing one if it exist right?
But then both sign in and sign up will have same code isn't it?
You can just create 1 button for it, and check in the server actions whether user is signed up or not. But keep in mind you'll have to ask for additional fields if google doesn't provide it
Answer
Loggerhead ShrikeOP
Okay, thank you very much Anay bro! I'll then create only one option and use it. I was so confused of whether to add sign up button or not as it will just be extra step but we're doing the same thing haha
Loggerhead ShrikeOP
Okay, did it