fix(security): restrict refresh token scope #103

Open
opened 2025-11-04 11:24:14 +00:00 by chartgerink · 1 comment
Owner

Set-Cookie: refreshToken=...; HttpOnly; Secure; SameSite=Strict; Path=/api/auth/refresh; Max-Age=604800

This helps secure the refresh token to only be transmitted when the appropriate endpoint is used. See also

https://junkangworld.com/blog/the-definitive-guide-to-refreshing-httponly-tokens#implementation-flow

> `Set-Cookie: refreshToken=...; HttpOnly; Secure; SameSite=Strict; Path=/api/auth/refresh; Max-Age=604800` This helps secure the refresh token to only be transmitted when the appropriate endpoint is used. See also https://junkangworld.com/blog/the-definitive-guide-to-refreshing-httponly-tokens#implementation-flow
chartgerink added this to the v2.0.0 milestone 2025-11-04 11:24:14 +00:00
Author
Owner

Will have to handle the middleware as it currently uses the presence/absence of refresh token in the logic.

access refresh result
x _ 200 (if valid)
_ x 401
_ _ _

It is important that the refresh process stays functional.

Will have to handle the middleware as it currently uses the presence/absence of refresh token in the logic. | access | refresh | result | | -- | -- | -- | | x | _ | 200 (if valid) | | _ | x | 401 | | _ | _ | _ | It is important that the refresh process stays functional.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
researchequals/api#103
No description provided.