From 028d1631bd4f21db71dbcc4012c33aeaae474414 Mon Sep 17 00:00:00 2001 From: Johannes <72809645+jobenjada@users.noreply.github.com> Date: Tue, 11 Apr 2023 09:51:00 +0200 Subject: [PATCH] remove console logs, tweak auth UI (#224) --- .../dummyUI/MultipleChoiceSingleQuestion.tsx | 2 +- apps/web/app/auth/login/page.tsx | 2 +- apps/web/app/auth/verification-requested/page.tsx | 15 +++++++-------- .../integrations/alerts/slack/page.tsx | 1 - .../settings/api-keys/EditApiKeys.tsx | 1 - apps/web/app/invite/page.tsx | 7 +++---- apps/web/components/auth/PasswordResetForm.tsx | 4 ++-- .../components/auth/RequestVerificationEmail.tsx | 2 +- apps/web/components/auth/SigninForm.tsx | 2 +- .../preview/MultipleChoiceSingleQuestion.tsx | 2 +- apps/web/components/preview/OpenTextQuestion.tsx | 2 +- apps/web/lib/email.ts | 2 +- 12 files changed, 19 insertions(+), 23 deletions(-) diff --git a/apps/formbricks-com/components/dummyUI/MultipleChoiceSingleQuestion.tsx b/apps/formbricks-com/components/dummyUI/MultipleChoiceSingleQuestion.tsx index 988f9a3966..56520607b6 100644 --- a/apps/formbricks-com/components/dummyUI/MultipleChoiceSingleQuestion.tsx +++ b/apps/formbricks-com/components/dummyUI/MultipleChoiceSingleQuestion.tsx @@ -25,7 +25,7 @@ export default function MultipleChoiceSingleQuestion({ const data = { [question.id]: e.currentTarget[question.id].value, }; - console.log(data); + e.currentTarget[question.id].value = ""; onSubmit(data); // reset form diff --git a/apps/web/app/auth/login/page.tsx b/apps/web/app/auth/login/page.tsx index 42bbe5baad..7bec506c80 100644 --- a/apps/web/app/auth/login/page.tsx +++ b/apps/web/app/auth/login/page.tsx @@ -9,7 +9,7 @@ export default function SignInPage() {
+ className="hover:text-brand-dark mt-3 grid grid-cols-1 space-y-2 text-center text-xs text-slate-700"> Create an account
diff --git a/apps/web/app/auth/verification-requested/page.tsx b/apps/web/app/auth/verification-requested/page.tsx index baf03d0f49..740fa48c01 100644 --- a/apps/web/app/auth/verification-requested/page.tsx +++ b/apps/web/app/auth/verification-requested/page.tsx @@ -9,17 +9,16 @@ export default function VerficationPage() {
{searchParams && searchParams?.get("email") ? ( <> -

Please verify your email address

-

- We have sent you an email to the address{" "} - {searchParams.get("email")}. Please click the link in the email to - activate your account. +

+ Please confirm your email address +

+

+ We sent an email to {searchParams.get("email")}. + Please click the link in the email to activate your account.


-

+

You didn't receive an email or your link expired? -
- Click the button below to request a new email.

diff --git a/apps/web/app/environments/[environmentId]/integrations/alerts/slack/page.tsx b/apps/web/app/environments/[environmentId]/integrations/alerts/slack/page.tsx index 150073d08d..f7d48d7097 100644 --- a/apps/web/app/environments/[environmentId]/integrations/alerts/slack/page.tsx +++ b/apps/web/app/environments/[environmentId]/integrations/alerts/slack/page.tsx @@ -28,7 +28,6 @@ export default function SlackAlertPage({ params }) { }; const deleteEmailAlert = async () => { - console.log("Delete email alert"); setDeleteDialogOpen(false); }; diff --git a/apps/web/app/environments/[environmentId]/settings/api-keys/EditApiKeys.tsx b/apps/web/app/environments/[environmentId]/settings/api-keys/EditApiKeys.tsx index 264f749e13..ca00fc4642 100644 --- a/apps/web/app/environments/[environmentId]/settings/api-keys/EditApiKeys.tsx +++ b/apps/web/app/environments/[environmentId]/settings/api-keys/EditApiKeys.tsx @@ -39,7 +39,6 @@ export default function EditAPIKeys({ }; const handleAddAPIKey = async (data) => { - console.log(data); const apiKey = await createApiKey(environmentTypeId, { label: data.label }); mutateApiKeys([...JSON.parse(JSON.stringify(apiKeys)), apiKey], false); setOpenAddAPIKeyModal(false); diff --git a/apps/web/app/invite/page.tsx b/apps/web/app/invite/page.tsx index 854f3ef7dc..f3468cda7e 100644 --- a/apps/web/app/invite/page.tsx +++ b/apps/web/app/invite/page.tsx @@ -14,7 +14,6 @@ import { export default async function JoinTeam({ searchParams }) { const currentUser = await getServerSession(authOptions); - console.log("user", currentUser); try { const { inviteId, email } = await verifyInviteToken(searchParams.token); @@ -27,7 +26,7 @@ export default async function JoinTeam({ searchParams }) { if (!currentUser) { const redirectUrl = env.NEXTAUTH_URL + "/invite?token=" + searchParams.token; return ; - } else if (currentUser.user.email !== email) { + } else if (currentUser.user?.email !== email) { return ; } else if (!invite) { return ; @@ -44,7 +43,7 @@ export default async function JoinTeam({ searchParams }) { }, user: { connect: { - id: currentUser.user.id, + id: currentUser.user?.id, }, }, role: invite.role, @@ -59,7 +58,7 @@ export default async function JoinTeam({ searchParams }) { }, }); - sendInviteAcceptedEmail(invite.creator.name, currentUser.user.name, invite.creator.email); + sendInviteAcceptedEmail(invite.creator.name, currentUser.user?.name, invite.creator.email); return ; } diff --git a/apps/web/components/auth/PasswordResetForm.tsx b/apps/web/components/auth/PasswordResetForm.tsx index 8ab840aaec..81b298e7b2 100644 --- a/apps/web/components/auth/PasswordResetForm.tsx +++ b/apps/web/components/auth/PasswordResetForm.tsx @@ -56,10 +56,10 @@ export const PasswordResetForm = ({}) => {
-
diff --git a/apps/web/components/auth/RequestVerificationEmail.tsx b/apps/web/components/auth/RequestVerificationEmail.tsx index 357e9e2e10..e403723a5c 100644 --- a/apps/web/components/auth/RequestVerificationEmail.tsx +++ b/apps/web/components/auth/RequestVerificationEmail.tsx @@ -20,7 +20,7 @@ export const RequestVerificationEmail = ({ email }: RequestEmailVerificationProp }; return ( <> - diff --git a/apps/web/components/auth/SigninForm.tsx b/apps/web/components/auth/SigninForm.tsx index d47852b71c..f5c2025a24 100644 --- a/apps/web/components/auth/SigninForm.tsx +++ b/apps/web/components/auth/SigninForm.tsx @@ -82,7 +82,7 @@ export const SigninForm = () => {
+ className="hover:text-brand-dark mt-3 grid grid-cols-1 space-y-2 text-center text-xs text-slate-700"> Forgot your password?
diff --git a/apps/web/components/preview/MultipleChoiceSingleQuestion.tsx b/apps/web/components/preview/MultipleChoiceSingleQuestion.tsx index aefe26527b..a1c9af5511 100644 --- a/apps/web/components/preview/MultipleChoiceSingleQuestion.tsx +++ b/apps/web/components/preview/MultipleChoiceSingleQuestion.tsx @@ -25,7 +25,7 @@ export default function MultipleChoiceSingleQuestion({ const data = { [question.id]: e.currentTarget[question.id].value, }; - console.log(data); + e.currentTarget[question.id].value = ""; onSubmit(data); // reset form diff --git a/apps/web/components/preview/OpenTextQuestion.tsx b/apps/web/components/preview/OpenTextQuestion.tsx index 596e07b572..eb355f3b85 100644 --- a/apps/web/components/preview/OpenTextQuestion.tsx +++ b/apps/web/components/preview/OpenTextQuestion.tsx @@ -22,7 +22,7 @@ export default function OpenTextQuestion({
{ e.preventDefault(); - console.log(e.currentTarget); + const data = { [question.id]: value, }; diff --git a/apps/web/lib/email.ts b/apps/web/lib/email.ts index 6d810ded14..b686c8f5be 100644 --- a/apps/web/lib/email.ts +++ b/apps/web/lib/email.ts @@ -41,7 +41,7 @@ export const sendVerificationEmail = async (user) => { subject: "Welcome to Formbricks 🤍", html: withEmailTemplate(`

Welcome!

To start using Formbricks please verify your email by clicking the button below:

- Verify email
+ Confirm email

The link is valid for 24h.

If it has expired please request a new token here: Request new verification