From 2c81db93be61b7154fe37ec9fd709806366ca93b Mon Sep 17 00:00:00 2001 From: Konstantin Date: Fri, 27 Dec 2024 09:19:22 +0300 Subject: [PATCH] docs: fix birthday comparison (#1029) --- docs/content/docs/guides/your-first-plugin.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/docs/guides/your-first-plugin.mdx b/docs/content/docs/guides/your-first-plugin.mdx index 0804bd7066..e7e0aa4659 100644 --- a/docs/content/docs/guides/your-first-plugin.mdx +++ b/docs/content/docs/guides/your-first-plugin.mdx @@ -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 plugins do If you have a plugin you’d like to share with the community, feel free to let us know through our Discord server, or through a pull-request -and we may add it to the community-plugins list! \ No newline at end of file +and we may add it to the community-plugins list!