Skip to content

Commit

Permalink
fix: secure session token
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed Dec 19, 2024
1 parent aab23d3 commit 3f91883
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/lib/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}` : "",
}
},
})
Expand All @@ -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>

0 comments on commit 3f91883

Please sign in to comment.