Conditionally prevent signup with email otp?

In my app I want to support both the signin and signup via email OTP. However my app needs the user to go through an onboarding before he can create a new account so I would like to be able to pass a parameter that determines if this request can create a new user or not.
const onSignUpPress = async (enableAccountCreation: boolean) => {
const { data, error } = await authClient.emailOtp.sendVerificationOtp({
email: emailAddress,
//maybe add a signup type to allow account creation?
type: enableAccountCreation? 'sign-up' : 'sign-in',
});
if (error) return;
setPendingVerification(true);
};
const onSignUpPress = async (enableAccountCreation: boolean) => {
const { data, error } = await authClient.emailOtp.sendVerificationOtp({
email: emailAddress,
//maybe add a signup type to allow account creation?
type: enableAccountCreation? 'sign-up' : 'sign-in',
});
if (error) return;
setPendingVerification(true);
};
3 Replies
Wizzel
WizzelOP5w ago
@Ping maybe you can help here?
Ping
Ping5w ago
Hey yeah we dont support this yet, we do intend to support this in the future though
Wizzel
WizzelOP5w ago
Okay I guess I’ll have to get creative then 😬 thanks for your answer!

Did you find this page helpful?