© 2026 Hedgehog Software, LLC
Object { message: "invalid token", code: "INVALID_TOKEN", status: 400, statusText: "BAD_REQUEST" }
async function onSubmit(dataPassword: any) { const token = new URLSearchParams(window.location.search).get("token"); console.log("token", token); try { await authClient.resetPassword( { newPassword: "dataPassword", }, { onResponse: () => {}, onRequest: () => {}, onSuccess: () => { console.log("Sucess"); }, onError: (ctx) => { console.log(ctx.error); }, } ); } catch (error) { console.log("Error in catch"); console.log(error); } }
import { betterAuth } from "better-auth"; import { prismaAdapter } from "better-auth/adapters/prisma"; import { PrismaClient } from "@prisma/client"; const prisma = new PrismaClient(); export const auth = betterAuth({ database: prismaAdapter(prisma, { provider: "sqlite", }), emailAndPassword: { minPasswordLength: 3, enabled: true, autoSignIn: true, }, session:{ cookieCache:{ enabled: true } }