mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 12:27:44 +00:00
lint
This commit is contained in:
@@ -5,7 +5,7 @@ import useMeasure from "react-use-measure";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Check, Copy, CornerRightUp } from "lucide-react";
|
import { Check, Copy } from "lucide-react";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
import { Highlight, themes } from "prism-react-renderer";
|
import { Highlight, themes } from "prism-react-renderer";
|
||||||
import { AnimatePresence, motion, MotionConfig } from "framer-motion";
|
import { AnimatePresence, motion, MotionConfig } from "framer-motion";
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ describe("have-i-been-pwned", async () => {
|
|||||||
});
|
});
|
||||||
expect(result.error).not.toBeNull();
|
expect(result.error).not.toBeNull();
|
||||||
expect(result.error?.status).toBe(400);
|
expect(result.error?.status).toBe(400);
|
||||||
expect(result.error?.code).toBe("THE_PASSWORD_YOU_ENTERED_HAS_BEEN_COMPROMISED_PLEASE_CHOOSE_A_DIFFERENT_PASSWORD");
|
expect(result.error?.code).toBe(
|
||||||
|
"THE_PASSWORD_YOU_ENTERED_HAS_BEEN_COMPROMISED_PLEASE_CHOOSE_A_DIFFERENT_PASSWORD",
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should allow account creation with strong, uncompromised password", async () => {
|
it("should allow account creation with strong, uncompromised password", async () => {
|
||||||
@@ -61,4 +63,3 @@ describe("have-i-been-pwned", async () => {
|
|||||||
expect(result.error?.status).toBe(400);
|
expect(result.error?.status).toBe(400);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import { betterFetch } from "@better-fetch/fetch";
|
|||||||
import type { BetterAuthPlugin } from "../../types";
|
import type { BetterAuthPlugin } from "../../types";
|
||||||
|
|
||||||
const ERROR_CODES = {
|
const ERROR_CODES = {
|
||||||
PASSWORD_COMPROMISED: "THE_PASSWORD_YOU_ENTERED_HAS_BEEN_COMPROMISED_PLEASE_CHOOSE_A_DIFFERENT_PASSWORD",
|
PASSWORD_COMPROMISED:
|
||||||
|
"THE_PASSWORD_YOU_ENTERED_HAS_BEEN_COMPROMISED_PLEASE_CHOOSE_A_DIFFERENT_PASSWORD",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
async function checkPasswordCompromise(
|
async function checkPasswordCompromise(
|
||||||
@@ -74,7 +75,6 @@ export const haveIBeenPwned = (options?: HaveIBeenPwnedOptions) =>
|
|||||||
);
|
);
|
||||||
return ctx.password.hash(password);
|
return ctx.password.hash(password);
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user