* Verify - inital email commit * Add token type - api redirect - migration * Redirect and valid api callback route * Update email design * Change signup URL to redirect to verify-email * Add feature flag - add a11y text to email - add top banner * Shell shouldnt redirect to onboarding if the user needs to verify account * Move flag check to server * Cleanup * Rate limit * Fix redirects * Remove api signup mess * Double negation for forced bool * Fix props * Update packages/emails/templates/account-verify-email.ts * Enable migration by default * Fix typos * Fix google verify issue * Update packages/features/auth/lib/verifyEmail.ts Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> * NITS: @harioms addressed * Remove schema changes * Fix NITs+ improvments * Update apps/web/pages/api/auth/verify-email.ts Co-authored-by: Omar López <zomars@me.com> * Update packages/features/ee/common/components/LicenseRequired.tsx Co-authored-by: Omar López <zomars@me.com> * Update apps/web/pages/api/auth/verify-email.ts Co-authored-by: Omar López <zomars@me.com> * Always preloads feature flags * Update verifyEmail.ts * Update schema.prisma * Type fix --------- Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: Omar López <zomars@me.com>
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import { APP_NAME } from "@calcom/lib/constants";
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
import { trpc } from "@calcom/trpc";
|
|
import useEmailVerifyCheck from "@calcom/trpc/react/hooks/useEmailVerifyCheck";
|
|
import { Button, TopBanner, showToast } from "@calcom/ui";
|
|
|
|
import { useFlagMap } from "../../flags/context/provider";
|
|
|
|
function VerifyEmailBanner() {
|
|
const flags = useFlagMap();
|
|
const { t } = useLocale();
|
|
const { data } = useEmailVerifyCheck();
|
|
const mutation = trpc.viewer.auth.resendVerifyEmail.useMutation();
|
|
|
|
if (data?.isVerified || !flags["email-verification"]) return null;
|
|
|
|
return (
|
|
<>
|
|
<TopBanner
|
|
text={t("verify_email_banner_body", { appName: APP_NAME })}
|
|
variant="warning"
|
|
actions={
|
|
<Button
|
|
onClick={() => {
|
|
mutation.mutate();
|
|
showToast(t("email_sent"), "success");
|
|
}}>
|
|
{t("verify_email_banner_button")}
|
|
</Button>
|
|
}
|
|
/>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default VerifyEmailBanner;
|