docs: add await to headers() calls in API examples

This commit is contained in:
KinfeMichael Tariku
2025-05-12 11:30:37 -07:00
committed by GitHub
parent 169a03baef
commit dd122da3e5

View File

@@ -21,7 +21,7 @@ export const auth = betterAuth({
// calling get session on the server
await auth.api.getSession({
headers: headers() //some endpoint might require headers
headers: await headers() // some endpoint might require headers
})
```
@@ -31,7 +31,7 @@ Unlike the client, the server needs the values to be passed as an object with th
```ts title="server.ts"
await auth.api.getSession({
headers: headers()
headers: await headers()
})
await auth.api.signInEmail({
@@ -39,7 +39,7 @@ await auth.api.signInEmail({
email: "john@doe.com",
password: "password"
},
headers: headers() // optional but would be useful to get the user IP, user agent, etc.
headers: await headers() // optional but would be useful to get the user IP, user agent, etc.
})
await auth.api.verifyEmail({