fix: clear cache cookies on signout

This commit is contained in:
Bereket Engida
2024-11-15 02:07:34 +03:00
parent 25b0059ac3
commit 59777322a9
2 changed files with 7 additions and 0 deletions

View File

@@ -28,6 +28,12 @@ export const auth = betterAuth({
dialect: libsql, dialect: libsql,
type: "sqlite", type: "sqlite",
}, },
session: {
cookieCache: {
enabled: true,
maxAge: 60,
},
},
emailVerification: { emailVerification: {
async sendVerificationEmail({ user, url }) { async sendVerificationEmail({ user, url }) {
console.log("Sending verification email to", user.email); console.log("Sending verification email to", user.email);

View File

@@ -15,6 +15,7 @@ export const signOut = createAuthEndpoint(
ctx.context.secret, ctx.context.secret,
); );
if (!sessionCookieToken) { if (!sessionCookieToken) {
deleteSessionCookie(ctx);
throw new APIError("BAD_REQUEST", { throw new APIError("BAD_REQUEST", {
message: "Session not found", message: "Session not found",
}); });