shadow
shadow
Explore posts from servers
BABetter Auth
Created by shadow on 4/16/2025 in #bug-reports
Email Verification required and Captcha return the same error code
Suggestion: It’d be much cleaner if the backend returned a more specific error code or identifier in the response body. For example:
{
"status": 403,
"code": "EMAIL_NOT_VERIFIED",
"message": "You need a verified email address to login."
}
{
"status": 403,
"code": "EMAIL_NOT_VERIFIED",
"message": "You need a verified email address to login."
}
And
{
"status": 403,
"code": "CAPTCHA_FAILED",
"message": "Captcha verification failed."
}
{
"status": 403,
"code": "CAPTCHA_FAILED",
"message": "Captcha verification failed."
}
This would allow the frontend to handle each case with proper context, like:
switch (ctx.error.code) {
case "EMAIL_NOT_VERIFIED":
toast.error("Please verify your email address. A verification link has been sent.");
break;
case "CAPTCHA_FAILED":
toast.error("Captcha failed. Please try again.");
break;
default:
toast.error("Access denied.");
}
switch (ctx.error.code) {
case "EMAIL_NOT_VERIFIED":
toast.error("Please verify your email address. A verification link has been sent.");
break;
case "CAPTCHA_FAILED":
toast.error("Captcha failed. Please try again.");
break;
default:
toast.error("Access denied.");
}
Let me know if this is already possible and I missed something β€” or if there’s a workaround. Thanks! πŸ™Œ
3 replies
BABetter Auth
Created by shadow on 3/28/2025 in #help
Middleware in a Better Auth Project
yep that's what I thought, thanks for the clarification! by the way, great project!
5 replies
BABetter Auth
Created by shadow on 3/7/2025 in #help
Trigger annualDiscountPriceId on Stripe
Something happened because now it returns the correct array with the subscription, closing issue.
5 replies
BABetter Auth
Created by shadow on 3/7/2025 in #help
Trigger annualDiscountPriceId on Stripe
No description
5 replies
BABetter Auth
Created by shadow on 2/27/2025 in #help
Error generating schemas.
Here is my file structure:
.
β”œβ”€β”€ app
β”‚ β”œβ”€β”€ api
β”‚ β”‚ └── auth
β”‚ β”‚ └── [...all]
β”‚ β”‚ └── route.ts
β”‚ β”œβ”€β”€ favicon.ico
β”‚ β”œβ”€β”€ globals.css
β”‚ β”œβ”€β”€ layout.tsx
β”‚ └── page.tsx
β”œβ”€β”€ components.json
β”œβ”€β”€ eslint.config.mjs
β”œβ”€β”€ lib
β”‚ β”œβ”€β”€ auth-client.ts
β”‚ β”œβ”€β”€ auth.ts
β”‚ └── utils.ts
β”œβ”€β”€ middleware.ts
β”œβ”€β”€ next.config.ts
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ postcss.config.mjs
β”œβ”€β”€ public
β”‚ β”œβ”€β”€ file.svg
β”‚ β”œβ”€β”€ globe.svg
β”‚ β”œβ”€β”€ next.svg
β”‚ β”œβ”€β”€ vercel.svg
β”‚ └── window.svg
β”œβ”€β”€ tailwind.config.ts
└── tsconfig.json
.
β”œβ”€β”€ app
β”‚ β”œβ”€β”€ api
β”‚ β”‚ └── auth
β”‚ β”‚ └── [...all]
β”‚ β”‚ └── route.ts
β”‚ β”œβ”€β”€ favicon.ico
β”‚ β”œβ”€β”€ globals.css
β”‚ β”œβ”€β”€ layout.tsx
β”‚ └── page.tsx
β”œβ”€β”€ components.json
β”œβ”€β”€ eslint.config.mjs
β”œβ”€β”€ lib
β”‚ β”œβ”€β”€ auth-client.ts
β”‚ β”œβ”€β”€ auth.ts
β”‚ └── utils.ts
β”œβ”€β”€ middleware.ts
β”œβ”€β”€ next.config.ts
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ postcss.config.mjs
β”œβ”€β”€ public
β”‚ β”œβ”€β”€ file.svg
β”‚ β”œβ”€β”€ globe.svg
β”‚ β”œβ”€β”€ next.svg
β”‚ β”œβ”€β”€ vercel.svg
β”‚ └── window.svg
β”œβ”€β”€ tailwind.config.ts
└── tsconfig.json
(This is a fresh NextJS project where i made it until step 4 in https://www.better-auth.com/docs/installation#configure-database, including step 4)
5 replies
BABetter Auth
Created by shadow on 1/15/2025 in #help
Added additional field, but authClient.signUp.email doesnt accept it
why i am getting this error when isFirst is true? am i correctly using the admin plugin?
{
code: "UNAUTHORIZED",
status: 401,
statusText: "UNAUTHORIZED"
}
{
code: "UNAUTHORIZED",
status: 401,
statusText: "UNAUTHORIZED"
}
4 replies