Can't find my jwt token inside my cookie!!
- Dominant language
- TypeScript
- Stars
- 50
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Hi Ben, i have done everything you said but when i launch my site and log in, i can't find my token inside cookie field. Whats the problem? Please help me.
```
login: async (parent, args, context, info) => {
const user = await Users.findOne({
personelNumber: args.data.personelNumber
}, function (err, myUser) {
console.log(err);
});
if (!user) {
throw new Error("User not found");
}
const isMatch = await bcrypt.compare(args.data.password, user.password);
if (!isMatch) {
throw new Error("Wrong password");
}
const refreshToken = generateToken(user.id)
context.res.cookie("refresh-token", refreshToken)
return user;
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the login resolver shown in the issue, then inspect the generateToken call and context.res.cookie invocation. No repository files or tests are identified; done would be confirming that a successful login produces the expected refresh-token cookie.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100