mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 20:27:44 +00:00
fix: clear cache cookies on signout
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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",
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user