- {/* Username textfield */}
-
+ {/* Username textfield: when not coming from signup */}
+ {!props.hideUsername &&
}
{/* Full name textfield */}
diff --git a/apps/web/pages/api/auth/signup.ts b/apps/web/pages/api/auth/signup.ts
index 13551b66f0..803d00bbfc 100644
--- a/apps/web/pages/api/auth/signup.ts
+++ b/apps/web/pages/api/auth/signup.ts
@@ -198,13 +198,13 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
id: foundToken.id,
},
});
+ } else {
+ await sendEmailVerification({
+ email: userEmail,
+ username,
+ language,
+ });
}
- await sendEmailVerification({
- email: userEmail,
- username,
- language,
- });
-
res.status(201).json({ message: "Created user" });
}
diff --git a/apps/web/pages/getting-started/[[...step]].tsx b/apps/web/pages/getting-started/[[...step]].tsx
index 345290d13b..46811b4ac2 100644
--- a/apps/web/pages/getting-started/[[...step]].tsx
+++ b/apps/web/pages/getting-started/[[...step]].tsx
@@ -42,6 +42,7 @@ const stepTransform = (step: (typeof steps)[number]) => {
const stepRouteSchema = z.object({
step: z.array(z.enum(steps)).default([INITIAL_STEP]),
+ from: z.string().optional(),
});
// TODO: Refactor how steps work to be contained in one array/object. Currently we have steps,initalsteps,headers etc. These can all be in one place
@@ -52,6 +53,7 @@ const OnboardingPage = () => {
const result = stepRouteSchema.safeParse(router.query);
const currentStep = result.success ? result.data.step[0] : INITIAL_STEP;
+ const from = result.success ? result.data.from : "";
const headers = [
{
@@ -141,7 +143,9 @@ const OnboardingPage = () => {
}>
- {currentStep === "user-settings" && goToIndex(1)} />}
+ {currentStep === "user-settings" && (
+ goToIndex(1)} hideUsername={from === "signup"} />
+ )}
{currentStep === "connected-calendar" && goToIndex(2)} />}
{currentStep === "connected-video" && goToIndex(3)} />}
diff --git a/apps/web/pages/signup.tsx b/apps/web/pages/signup.tsx
index bb18fe4261..2184a8295e 100644
--- a/apps/web/pages/signup.tsx
+++ b/apps/web/pages/signup.tsx
@@ -78,9 +78,11 @@ export default function Signup({ prepopulateFormValues, token, orgSlug }: Signup
const verifyOrGettingStarted = flags["email-verification"] ? "auth/verify-email" : "getting-started";
await signIn<"credentials">("credentials", {
...data,
- callbackUrl: router.query.callbackUrl
- ? `${WEBAPP_URL}/${router.query.callbackUrl}`
- : `${WEBAPP_URL}/${verifyOrGettingStarted}`,
+ callbackUrl: `${
+ router.query.callbackUrl
+ ? `${WEBAPP_URL}/${router.query.callbackUrl}`
+ : `${WEBAPP_URL}/${verifyOrGettingStarted}`
+ }?from=signup`,
});
})
.catch((err) => {