fix: secure session token

This commit is contained in:
Stephen Zhou 2024-12-19 15:08:26 +08:00
parent aab23d3a34
commit 3f91883f5e
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@ If you prefer to develop in Electron, follow these steps:
pnpm run dev
```
> **Tip:** If you encounter login issues, copy the `better-auth.session_token` from your browser's cookies into the app.
> **Tip:** If you encounter login issues, copy the `__Secure-better-auth.session_token` from your browser's cookies into the app.
## Contribution Guidelines

View File

@ -126,7 +126,7 @@ pnpm run dev
Since it is not very convenient to develop in Electron, the first way to develop and contribute is recommended at this stage.
> [!TIP]
> If you can't log in to the app, copy the `better-auth.session_token` in the cookie from your browser into the app.
> If you can't log in to the app, copy the `__Secure-better-auth.session_token` in the cookie from your browser into the app.
## 📝 License

View File

@ -59,7 +59,7 @@ export const createApiClient = () => {
"X-App-Version": PKG.version,
"X-App-Dev": isDev ? "1" : "0",
"User-Agent": `Follow External Server Api Client/${PKG.version}`,
Cookie: authSessionToken ? `better-auth.session_token=${authSessionToken}` : "",
Cookie: authSessionToken ? `__Secure-better-auth.session_token=${authSessionToken}` : "",
}
},
})
@ -78,7 +78,7 @@ export const getTokenFromCookie = (cookie: string) => {
},
{} as Record<string, string>,
)
return parsedCookieMap["better-auth.session_token"]
return parsedCookieMap["__Secure-better-auth.session_token"]
}
export type ApiClient = ReturnType<typeof createApiClient>