diff --git a/apps/remix/app/routes/_h._index.tsx b/apps/remix/app/routes/_h._index.tsx index 9a95464..a7f7005 100644 --- a/apps/remix/app/routes/_h._index.tsx +++ b/apps/remix/app/routes/_h._index.tsx @@ -25,6 +25,7 @@ import Info from "~/components/icons/Info"; import { useTranslation } from "react-i18next"; import { useSenderModal } from "~/components/sender"; +import { getRandomCharacter } from "lib/hooks/utlis"; export const meta: MetaFunction = () => { return [ @@ -116,7 +117,7 @@ export const action: ActionFunction = async ({ request }) => { }; } - const mailbox = `${randomName("", ".")}@${domain}`; + const mailbox = `${randomName("", getRandomCharacter())}@${domain}`; const userMailbox = await userMailboxCookie.serialize(mailbox); return redirect("/", { headers: { diff --git a/apps/remix/lib/hooks/utlis.ts b/apps/remix/lib/hooks/utlis.ts new file mode 100644 index 0000000..8ebcb00 --- /dev/null +++ b/apps/remix/lib/hooks/utlis.ts @@ -0,0 +1,4 @@ +export function getRandomCharacter(): string { + const characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ."; + return characters.charAt(Math.floor(Math.random() * characters.length)); +}