mirror of
https://github.com/better-auth/better-auth.git
synced 2026-10-20 20:26:55 -05:00
docs: hint to use credentials: 'omit' for authenticated requests (#4369)
Co-authored-by: Hendrik Krebs <hendrik@MacBook-Pro-von-Hendrik.fritz.box>
This commit is contained in:
co-authored by
Hendrik Krebs
parent
8849a9bcb3
commit
d5081fde19
@@ -362,7 +362,11 @@ const makeAuthenticatedRequest = async () => {
|
||||
const headers = {
|
||||
"Cookie": cookies, // [!code highlight]
|
||||
};
|
||||
const response = await fetch("http://localhost:8081/api/secure-endpoint", { headers });
|
||||
const response = await fetch("http://localhost:8081/api/secure-endpoint", {
|
||||
headers,
|
||||
// 'include' can interfere with the cookies we just set manually in the headers
|
||||
credentials: "omit" // [!code highlight]
|
||||
});
|
||||
const data = await response.json();
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user