DummyJSON.com provides different types of REST Endpoints filled with JSON data which you can use in developing the frontend with your favorite framework and library without worrying about writing a backend.
The idea is to directly use the "Set-Cookie" headers from the original response inside a Next.js middleware. As you can see in the following screenshot:
The response uses token instead of accessToken or vice versa. I guess it's mostly used as a token except for the "Set-Cookie" header.
Even if I used expiresInMins as "3," the "Set-Cookie" headers have the same dates.
Since this could be a breaking change for many users, I will display a warning (banner) on the web before making it. Afterward, we will be using accessToken instead of token.
My code includes the following implementation:
The idea is to directly use the "Set-Cookie" headers from the original response inside a Next.js middleware. As you can see in the following screenshot:
token
instead ofaccessToken
or vice versa. I guess it's mostly used as atoken
except for the "Set-Cookie" header.expiresInMins
as "3," the "Set-Cookie" headers have the same dates.