add random separator

This commit is contained in:
yesmore committed 2024-04-06 17:03:29 +08:00
1 parent dc61591c83
commit 100cc1e86d
2 files changed
+6 -1

No files matched your search

+2 -1
View File
@@ -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: {
+4
View File
@@ -0,0 +1,4 @@
export function getRandomCharacter(): string {
const characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.";
return characters.charAt(Math.floor(Math.random() * characters.length));
}