Skip to content

AUTH: access token naming issue #1260

@mdkaifansari04

Description

@mdkaifansari04

Important Points to Note

  • I agree to adhere to the project's Code of Conduct.
  • I have reviewed and understood the project's Contributing Guidelines.
  • I have checked the existing issues and can confirm that this is not a duplicate.
  • I have reviewed and understood the project's Issue Creation Guidelines.

Bug Description

bro there is issue with your auth flow.

you have set the cookie named as access_token and the you are accesssing it as token

    res.cookie('access_token', token, {
      httpOnly: true,
      secure: NODE_ENV === NodeEnv.PRODUCTION,
      sameSite: 'strict',
      maxAge: 7 * 24 * 60 * 60 * 1000, // 7 days
    });

and auth middleware

  const token = req.cookies.token;
  console.log(req.cookies);

it is coming in the server as (when i logged )

{
  access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2OGRlN2Y5MzllZDdiNGYwYTlmMTcwNjciLCJlbWFpbCI6IjY4ZGU3ZjkzOWVkN2I0ZjBhOWYxNzA2NSIsImlhdCI6MTc1OTQxNDEyNywiZXhwIjoxNzU5NDE0MTM0fQ.VGrDHLTIzt-v8iDy9j6FLqUnS9hcO-XUbEh5oW_9UiE'
}```

### Is this bug related to the main website or any sub-projects?

Main Website

### Screenshots or Logs

<img width="1152" height="728" alt="Image" src="https://github.com/user-attachments/assets/c1c3235d-3c79-4658-904b-0ad0204d5ebd" />

### Priority

Up to 2 days

### Open Source Programs

None

### Would you like to work on this issue?

Yes

Metadata

Metadata

Type

Projects

Status

done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions