DEV Community

Discussion on: NextJS Auth With Prisma And Refresh Tokens (JWT)

Collapse
 
talr98 profile image
Tal Rofe

Very helpful. Would you recommend on storing the access token within Redux store, or SessionStorage? To me, these 2 methods are same in aspects of security

Collapse
 
antonm7 profile image
antonm7

Agree.Those are good methods.

Collapse
 
2color profile image
Daniel Norman

That's correct.

As far as I know, If you're rolling your own authentication, a session token in an HttpOnly cookie should suffice.

The main reason to separate the access and refresh token is in cases where you need access to the token on the client side, e.g. to make requests from an iFrame or in situations where you don't have access to the cookies.