mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-30 02:46:44 -05:00
docs: fix birthday comparison (#1029)
This commit is contained in:
@@ -134,7 +134,7 @@ import { createAuthMiddleware } from "better-auth/plugins";
|
||||
const today = new Date();
|
||||
const fiveYearsAgo = new Date(today.setFullYear(today.getFullYear() - 5));
|
||||
|
||||
if(birthday <= fiveYearsAgo) {
|
||||
if(birthday >= fiveYearsAgo) {
|
||||
throw new APIError("BAD_REQUEST", { message: "User must be above 5 years old." });
|
||||
}
|
||||
|
||||
@@ -230,4 +230,4 @@ We highly recommend you visit our <Link href="/docs/concepts/plugins">plugins do
|
||||
If you have a plugin you’d like to share with the community, feel free to let us know through
|
||||
our <Link href="https://discord.gg/6jHcdYMzyq">Discord server</Link>,
|
||||
or through a <Link href="https://github.com/better-auth/better-auth/pulls">pull-request</Link>
|
||||
and we may add it to the <Link href="/docs/plugins/community-plugins">community-plugins</Link> list!
|
||||
and we may add it to the <Link href="/docs/plugins/community-plugins">community-plugins</Link> list!
|
||||
|
||||
Reference in New Issue
Block a user