Skip to content

Commit 3f7debd

Browse files
authored
docs: add Content-Type header for JWT authentication (#12513)
### What? Fix docs fragment about JWT strategy authentication ### Why? The example in docs doesn't work out of the box <img width="535" alt="image" src="https://github.com/user-attachments/assets/ae62b89e-25bd-4d50-b64f-f0edb4f40ca7" /> Solution is to set `Content-Type: application/json` <img width="819" alt="image" src="https://github.com/user-attachments/assets/4e645576-071d-436d-a5e2-eaa9e218f855" />
1 parent 5635ec5 commit 3f7debd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/authentication/jwt.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Example:
2323
```ts
2424
const user = await fetch('http://localhost:3000/api/users/login', {
2525
method: 'POST',
26+
headers: {
27+
'Content-Type': 'application/json',
28+
},
2629
body: JSON.stringify({
2730
2831
password: 'password',

0 commit comments

Comments
 (0)