Skip to content

Commit

Permalink
fix: Skip onboarding for invite (#2246)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruwang committed Mar 21, 2024
1 parent 96b6b53 commit 3c80eb3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion apps/web/app/(auth)/invite/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { sendInviteAcceptedEmail } from "@formbricks/lib/emails/emails";
import { deleteInvite, getInvite } from "@formbricks/lib/invite/service";
import { verifyInviteToken } from "@formbricks/lib/jwt";
import { createMembership } from "@formbricks/lib/membership/service";
import { updateUser } from "@formbricks/lib/user/service";

import {
ExpiredContent,
Expand Down Expand Up @@ -44,7 +45,7 @@ export default async function InvitePage({ searchParams }) {
await deleteInvite(inviteId);

sendInviteAcceptedEmail(invite.creator.name ?? "", session.user?.name ?? "", invite.creator.email);

updateUser(session.user.id, { onboardingCompleted: true });
return <RightAccountContent />;
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const TEXT_RESPONSES_PER_PAGE = 5;

export const DEFAULT_TEAM_ID = env.DEFAULT_TEAM_ID;
export const DEFAULT_TEAM_ROLE = env.DEFAULT_TEAM_ROLE;
export const ONBOARDING_DISABLED = env.ONBOARDING_DISABLED;
export const ONBOARDING_DISABLED = env.ONBOARDING_DISABLED === "1";

// Storage constants
export const AWS_ACCESS_KEY_ID = env.AWS_ACCESS_KEY_ID;
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const env = createEnv({
OIDC_ISSUER: z.string().optional(),
OIDC_SIGNING_ALGORITHM: z.string().optional(),
OPENTELEMETRY_LISTENER_URL: z.string().optional(),
ONBOARDING_DISABLED: z.string().optional(),
ONBOARDING_DISABLED: z.enum(["1", "0"]).optional(),
PASSWORD_RESET_DISABLED: z.enum(["1", "0"]).optional(),
PRIVACY_URL: z
.string()
Expand Down

0 comments on commit 3c80eb3

Please sign in to comment.