chore: upgrade better-call

This commit is contained in:
Bereket Engida
2024-10-12 04:17:00 +03:00
parent a95a1ab4bd
commit 3b842cbdbb
4 changed files with 12 additions and 16 deletions

View File

@@ -93,7 +93,7 @@
"@simplewebauthn/browser": "^10.0.0", "@simplewebauthn/browser": "^10.0.0",
"@simplewebauthn/server": "^10.0.1", "@simplewebauthn/server": "^10.0.1",
"arctic": "2.0.0-next.9", "arctic": "2.0.0-next.9",
"better-call": "0.2.5", "better-call": "0.2.6",
"c12": "^1.11.2", "c12": "^1.11.2",
"chalk": "^5.3.0", "chalk": "^5.3.0",
"commander": "^12.1.0", "commander": "^12.1.0",

View File

@@ -79,12 +79,12 @@ export const signInOAuth = createAuthEndpoint(
"redirect_uri", "redirect_uri",
`${c.context.baseURL}/callback/${c.body.provider}`, `${c.context.baseURL}/callback/${c.body.provider}`,
); );
return { return c.json({
url: url.toString(), url: url.toString(),
state: state.state, state: state.state,
codeVerifier, codeVerifier,
redirect: true, redirect: true,
}; });
}, },
); );

View File

@@ -100,8 +100,10 @@ export function getCookies(options: BetterAuthOptions) {
export function createCookieGetter(options: BetterAuthOptions) { export function createCookieGetter(options: BetterAuthOptions) {
const secure = const secure =
!!options.advanced?.useSecureCookies || options.advanced?.useSecureCookies !== undefined
process.env.NODE_ENV === "production"; ? options.advanced?.useSecureCookies
: options.baseURL?.startsWith("https://") ||
process.env.NODE_ENV === "production";
const secureCookiePrefix = secure ? "__Secure-" : ""; const secureCookiePrefix = secure ? "__Secure-" : "";
const cookiePrefix = "better-auth"; const cookiePrefix = "better-auth";
@@ -164,12 +166,6 @@ export function deleteSessionCookie(ctx: GenericEndpointContext) {
ctx.setCookie(ctx.context.authCookies.sessionToken.name, "", { ctx.setCookie(ctx.context.authCookies.sessionToken.name, "", {
maxAge: 0, maxAge: 0,
}); });
ctx.setCookie(ctx.context.authCookies.pkCodeVerifier.name, "", {
maxAge: 0,
});
ctx.setCookie(ctx.context.authCookies.state.name, "", {
maxAge: 0,
});
ctx.setCookie(ctx.context.authCookies.dontRememberToken.name, "", { ctx.setCookie(ctx.context.authCookies.dontRememberToken.name, "", {
maxAge: 0, maxAge: 0,
}); });

10
pnpm-lock.yaml generated
View File

@@ -1478,8 +1478,8 @@ importers:
specifier: 2.0.0-next.9 specifier: 2.0.0-next.9
version: 2.0.0-next.9 version: 2.0.0-next.9
better-call: better-call:
specifier: 0.2.5 specifier: 0.2.6
version: 0.2.5 version: 0.2.6
c12: c12:
specifier: ^1.11.2 specifier: ^1.11.2
version: 1.11.2(magicast@0.3.5) version: 1.11.2(magicast@0.3.5)
@@ -6874,8 +6874,8 @@ packages:
better-call@0.2.3-beta.2: better-call@0.2.3-beta.2:
resolution: {integrity: sha512-ybOtGcR4pOsHI2XE+urR9zcmK+s0YnhJSx8KDj6ul7MUEyYOiMEnq/bylyH62/7qXuYb9q8Oqkp9NF9vWOZ4Mg==} resolution: {integrity: sha512-ybOtGcR4pOsHI2XE+urR9zcmK+s0YnhJSx8KDj6ul7MUEyYOiMEnq/bylyH62/7qXuYb9q8Oqkp9NF9vWOZ4Mg==}
better-call@0.2.5: better-call@0.2.6:
resolution: {integrity: sha512-110c1YTmkPsdHs3+xqXZd+h56EuXYh/E5Wy7ILfjpv9ZefyXPFcvLSVEy/ikosIdISoXHJJjt3m9dphGEHK54A==} resolution: {integrity: sha512-RoIOW8Qm/y3FBIkAMaGlgpc/mc7g2i9HJ6lHdyiORXdUpzm1tv9eWD73aeeOmxVcJaQ9F65e6aIL+6kMsmO2hA==}
better-sqlite3@11.3.0: better-sqlite3@11.3.0:
resolution: {integrity: sha512-iHt9j8NPYF3oKCNOO5ZI4JwThjt3Z6J6XrcwG85VNMVzv1ByqrHWv5VILEbCMFWDsoHhXvQ7oC8vgRXFAKgl9w==} resolution: {integrity: sha512-iHt9j8NPYF3oKCNOO5ZI4JwThjt3Z6J6XrcwG85VNMVzv1ByqrHWv5VILEbCMFWDsoHhXvQ7oC8vgRXFAKgl9w==}
@@ -21532,7 +21532,7 @@ snapshots:
set-cookie-parser: 2.7.0 set-cookie-parser: 2.7.0
typescript: 5.6.2 typescript: 5.6.2
better-call@0.2.5: better-call@0.2.6:
dependencies: dependencies:
'@better-fetch/fetch': 1.1.9 '@better-fetch/fetch': 1.1.9
'@types/set-cookie-parser': 2.4.10 '@types/set-cookie-parser': 2.4.10