diff --git a/app/auth/mutations/login.ts b/app/auth/mutations/login.ts
index 9a09a7d..5afb76d 100644
--- a/app/auth/mutations/login.ts
+++ b/app/auth/mutations/login.ts
@@ -40,16 +40,9 @@ export default resolver.pipe(resolver.zod(Login), async ({ email, password }, ct
const user = await authenticateUser(email, password);
const organization = user.memberships[0]!.organization;
- const hasCompletedOnboarding =
- Boolean(organization.twilioAccountSid) &&
- Boolean(organization.twilioAuthToken) &&
- Boolean(organization.twilioApiKey) &&
- Boolean(organization.twilioApiSecret) &&
- Boolean(organization.phoneNumbers.length > 1);
await ctx.session.$create({
userId: user.id,
roles: [user.role, user.memberships[0]!.role],
- hasCompletedOnboarding: hasCompletedOnboarding || undefined,
orgId: organization.id,
});
diff --git a/app/auth/mutations/signup.ts b/app/auth/mutations/signup.ts
index de100a1..11a3f8e 100644
--- a/app/auth/mutations/signup.ts
+++ b/app/auth/mutations/signup.ts
@@ -31,6 +31,7 @@ export default resolver.pipe(resolver.zod(Signup), async ({ email, password, ful
userId: user.id,
roles: [user.role, user.memberships[0]!.role],
orgId: user.memberships[0]!.organizationId,
+ shouldShowWelcomeMessage: true,
});
return user;
});
diff --git a/app/auth/pages/sign-up.tsx b/app/auth/pages/sign-up.tsx
index 1494629..449371f 100644
--- a/app/auth/pages/sign-up.tsx
+++ b/app/auth/pages/sign-up.tsx
@@ -29,7 +29,7 @@ const SignUp: BlitzPage = () => {
onSubmit={async (values) => {
try {
await signupMutation(values);
- router.push(Routes.StepOne());
+ await router.push(Routes.Welcome());
} catch (error: any) {
if (error.code === "P2002" && error.meta?.target?.includes("email")) {
// This error comes from Prisma
@@ -47,7 +47,13 @@ const SignUp: BlitzPage = () => {
);
};
-SignUp.redirectAuthenticatedTo = Routes.StepOne();
+SignUp.redirectAuthenticatedTo = ({ session }) => {
+ if (session.shouldShowWelcomeMessage) {
+ return Routes.Welcome();
+ }
+
+ return Routes.Messages();
+};
SignUp.getLayout = (page) =>
Thanks for joining Shellphone
+Let us know if you need our help
+Make sure to set up your phone number
+ +
+ Head over to your settings
+
+ to set up your phone number.
+