vladwulf / nestjs-jwts

NestJs jwt tutorial using access and refresh tokens

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strategy jwt-refresh is confusing

BITRU opened this issue · comments

commented

Thanks for the tutorial, it is awsome.

But jwt-refresh Strategy for me looks strange.
Why you provide refresh-token in a Header Authorization with Bearer (tag?).
Replacing Access-tokeen only for one link with the same Bearer tag looks strange.

Maby is better to put refresh-token in body? for this refresh action?

Thanks again for tutorial!

@vladwulf Thankyou for the tutorial.
But, how do we work with the refresh token in frontend.? Usually we send a request to the server with the bearer token in the header, which is our access token. And the server validates the AT and throws Forbidden error if it expires. In this case, should the client send another request to the server to get the new AT using the RT ?
please share your thoughts on this