I’m building an invited-only type of feature where member can only be invited (not self signup).
In order to implement that, I try to create user programmatically using userCreate mutation, but don’t know how to create a password for that user since userSignupWithPassword cannot be used (email already exits)
Please advise.
Hello,
To make sure i understand, you want to create a user with a password as an invite only? Or, create user with an invite that they then set their password?
Last, you say password already exists because you used userCreate to create it?
Tim
Hi Timothy,
I want to create a user with a password as an invite-only.
Hello,
It’s super hard to help you out from here not understanding context, what auth provider you’re using etc. But basically, it depends on which auth provider you’re using:
-
if it’s the 8base auth system - use userSignupWithPassword without userCreate. this mutation will create user in 8base and in 8base auth
-
if it’s you’re using your own auth system - user userSignupWithToken, also don’t use userCreate mutation
Hope this helps. PS: There are a number of examples - similar ish - in this community from the past that may be helpful as well.
Tim
Hi Timothy,
Thanks for your support.
Let me clarify a bit.
I try userSignupWithPassword instead of userCreate, but the problem with that is
- You need to emit auth header otherwise you will receive “Sign up with password cannot be used, when authorization is specified” error
- You need to enable self-signup option on Authentication Profiles, mean that anyone could call the api and able to create a user (no-longer invited only)
What I try to do is creating invited-only user using 8base auth. Try to search for that but don’t get any luck.
Please advise
Hey @hunterbmt, due the userSignupWithPassword
resolver is no longer recommended for security reasons, I recommend you to create a custom authentication profile with a third-party service like Auth0 or any other Open ID service of your preference to store and manage the authentication and create some custom resolvers to fit your requirements to make things like create invitations and their authentication profiles I know that take time but 8base allow you to be as flexible as you need it. You can see more in Authentication | 8base Docs.