Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Skip onboarding for invite #2246

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/web/app/(auth)/invite/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { finishOnboardingAction } from "@/app/(app)/onboarding/actions";
import { getServerSession } from "next-auth";

import { authOptions } from "@formbricks/lib/authOptions";
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using destructuring to make the code more readable and clean. This will also help in avoiding repetition of code.

Suggested change
sendInviteAcceptedEmail(invite.creator.name ?? "", session.user?.name ?? "", invite.creator.email);
const { name, email } = invite.creator;
sendInviteAcceptedEmail(name ?? "", session.user?.name ?? "", email);


finishOnboardingAction();
Dhruwang marked this conversation as resolved.
Show resolved Hide resolved
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
Loading