mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-20 10:31:14 -06:00
remove console logs, tweak auth UI (#224)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -9,7 +9,7 @@ export default function SignInPage() {
|
||||
<div>
|
||||
<Link
|
||||
href="/auth/signup"
|
||||
className="text-sky mt-3 grid grid-cols-1 space-y-2 text-center text-xs hover:text-teal-600">
|
||||
className="hover:text-brand-dark mt-3 grid grid-cols-1 space-y-2 text-center text-xs text-slate-700">
|
||||
Create an account
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -9,17 +9,16 @@ export default function VerficationPage() {
|
||||
<div>
|
||||
{searchParams && searchParams?.get("email") ? (
|
||||
<>
|
||||
<h1 className="leading-2 mb-4 text-center font-bold">Please verify your email address</h1>
|
||||
<p className="text-center">
|
||||
We have sent you an email to the address{" "}
|
||||
<span className="italic">{searchParams.get("email")}</span>. Please click the link in the email to
|
||||
activate your account.
|
||||
<h1 className="leading-2 mb-4 text-center text-lg font-semibold text-slate-900">
|
||||
Please confirm your email address
|
||||
</h1>
|
||||
<p className="text-center text-sm text-slate-700">
|
||||
We sent an email to <span className="font-semibold italic">{searchParams.get("email")}</span>.
|
||||
Please click the link in the email to activate your account.
|
||||
</p>
|
||||
<hr className="my-4" />
|
||||
<p className="text-center text-xs">
|
||||
<p className="text-center text-xs text-slate-500">
|
||||
You didn't receive an email or your link expired?
|
||||
<br />
|
||||
Click the button below to request a new email.
|
||||
</p>
|
||||
<div className="mt-5">
|
||||
<RequestVerificationEmail email={searchParams.get("email")} />
|
||||
|
||||
@@ -28,7 +28,6 @@ export default function SlackAlertPage({ params }) {
|
||||
};
|
||||
|
||||
const deleteEmailAlert = async () => {
|
||||
console.log("Delete email alert");
|
||||
setDeleteDialogOpen(false);
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 <NotLoggedInContent email={email} token={searchParams.token} redirectUrl={redirectUrl} />;
|
||||
} else if (currentUser.user.email !== email) {
|
||||
} else if (currentUser.user?.email !== email) {
|
||||
return <WrongAccountContent />;
|
||||
} else if (!invite) {
|
||||
return <ExpiredContent />;
|
||||
@@ -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 <RightAccountContent />;
|
||||
}
|
||||
|
||||
@@ -56,10 +56,10 @@ export const PasswordResetForm = ({}) => {
|
||||
|
||||
<div>
|
||||
<Button type="submit" className="w-full justify-center">
|
||||
Send password reset email
|
||||
Reset password
|
||||
</Button>
|
||||
<div className="mt-3 text-center">
|
||||
<Button variant="secondary" href="/auth/login" className="w-full justify-center">
|
||||
<Button variant="minimal" href="/auth/login" className="w-full justify-center">
|
||||
Back to login
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@ export const RequestVerificationEmail = ({ email }: RequestEmailVerificationProp
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<Button onClick={requestVerificationEmail} className="w-full justify-center">
|
||||
<Button variant="secondary" onClick={requestVerificationEmail} className="w-full justify-center">
|
||||
Request a new verification mail
|
||||
</Button>
|
||||
</>
|
||||
|
||||
@@ -82,7 +82,7 @@ export const SigninForm = () => {
|
||||
<div>
|
||||
<Link
|
||||
href="/auth/forgot-password"
|
||||
className="text-sky mt-3 grid grid-cols-1 space-y-2 text-center text-xs hover:text-sky-600">
|
||||
className="hover:text-brand-dark mt-3 grid grid-cols-1 space-y-2 text-center text-xs text-slate-700">
|
||||
Forgot your password?
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function OpenTextQuestion({
|
||||
<form
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
console.log(e.currentTarget);
|
||||
|
||||
const data = {
|
||||
[question.id]: value,
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ export const sendVerificationEmail = async (user) => {
|
||||
subject: "Welcome to Formbricks 🤍",
|
||||
html: withEmailTemplate(`<h1>Welcome!</h1>
|
||||
To start using Formbricks please verify your email by clicking the button below:<br/><br/>
|
||||
<a class="button" href="${verifyLink}">Verify email</a><br/>
|
||||
<a class="button" href="${verifyLink}">Confirm email</a><br/>
|
||||
<br/>
|
||||
<strong>The link is valid for 24h.</strong><br/><br/>If it has expired please request a new token here:
|
||||
<a href="${verificationRequestLink}">Request new verification</a><br/>
|
||||
|
||||
Reference in New Issue
Block a user