benawad / benawad/jwt-auth-example

cookie is not set in the browser

Open
#30 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
463
Forks
119
PR merge metrics
No merged PRs in 30d

Description

![image](https://user-images.githubusercontent.com/58948904/122648934-f7318400-d148-11eb-91d5-6baccb3dbcbf.png)

Even though the cookie is present with response, the cookie is not setting the browser. I am also setting credentials to true.

```
const client = createClient({
url: "http://localhost:4000/graphql",
fetchOptions: {
credentials: "include",
},
});
```

```
app.use(
cors({
origin: "http://localhost:3000",
credentials: true,
})
);
```
I am also setting the cors in the server

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the client createClient configuration and the server cors({ origin, credentials }) configuration shown in the issue. Reproduce the request in the browser and inspect the response's cookie and browser cookie policy. Done means identifying and documenting the configuration change that allows the cookie to be stored.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api, authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.