Skip to content

Commit f1d272b

Browse files
fix: replace remaining cookie 'options' references with 'attributes'
- Fix last-login-method plugin to use authCookies.sessionToken.attributes - Fix mcp and oidc-provider plugins to use 'attributes' in expireCookie calls - Resolves TypeScript compilation errors after cookie refactoring Co-authored-by: Alex Yang <himself65@users.noreply.github.com>
1 parent 88f4468 commit f1d272b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/better-auth/src/plugins/last-login-method/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const lastLoginMethod = <O extends LastLoginMethodOptions>(
153153
// Inherit cookie attributes from Better Auth's centralized cookie system
154154
// This ensures consistency with cross-origin, cross-subdomain, and security settings
155155
const cookieAttributes = {
156-
...ctx.context.authCookies.sessionToken.options,
156+
...ctx.context.authCookies.sessionToken.attributes,
157157
maxAge: config.maxAge,
158158
httpOnly: false, // Override: plugin cookies are not httpOnly
159159
};

packages/better-auth/src/plugins/mcp/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export const mcp = (options: MCPOptions) => {
207207
}
208208
expireCookie(ctx, {
209209
name: "oidc_login_prompt",
210-
options: { path: "/" },
210+
attributes: { path: "/" },
211211
});
212212
const sessionCookie = parsedSetCookieHeader.get(cookieName)?.value;
213213
const sessionToken = sessionCookie?.split(".")[0]!;

packages/better-auth/src/plugins/oidc-provider/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ export const oidcProvider = (options: OIDCOptions) => {
403403
}
404404
expireCookie(ctx, {
405405
name: "oidc_login_prompt",
406-
options: { path: "/" },
406+
attributes: { path: "/" },
407407
});
408408
const sessionCookie = parsedSetCookieHeader.get(cookieName)?.value;
409409
const sessionToken = sessionCookie?.split(".")[0]!;
@@ -583,7 +583,7 @@ export const oidcProvider = (options: OIDCOptions) => {
583583
// Clear the cookie
584584
expireCookie(ctx, {
585585
name: "oidc_consent_prompt",
586-
options: { path: "/" },
586+
attributes: { path: "/" },
587587
});
588588

589589
const value = JSON.parse(verification.value) as CodeVerificationValue;

0 commit comments

Comments
 (0)