add random separator
This commit is contained in:
1 parent
dc61591c83
commit
100cc1e86d
2 files changed
+6
-1
No files matched your search
@@ -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: {
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export function getRandomCharacter(): string {
|
||||
const characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.";
|
||||
return characters.charAt(Math.floor(Math.random() * characters.length));
|
||||
}
|
||||
Reference in new issue
Block a user