---
title: "Lihai Ben-Haim (@lihaibh) | Hashnode"
description: "Lihai Ben-Haim (@lihaibh) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@lihaibh"
---

@lihaibh

# Lihai Ben-Haim

@lihaibh · Joined September 2020

## Comments

[Hey Gal thank you for this amazing thread ive learn alot. However i have some questions: How JWT in memory protects against XSS attacks as if XSS attack occurs an attacker can access all the resources a client has. On a "refresh-token" call i saw you are creating both refresh token and an access token, this can eventually increase the login expiration time to indefinitely as we call "refresh\_token" before the access token expires and the access token should have short expiry time. In case of a common server <-> client communication (not micro services) i dont see the reason why to encrypt the access\_token. You should not read the jwt payload on the client side?](https://hashnode.com/posts/react-nodejs-and-jwt-authentication-the-right-way/5f4ff0aec48c6b29cd2ecd0a/comment/5f7837917d160d41227d7363)

Comment · Article · Oct 3, 2020 · [React, NodeJS and JWT Authentication - the right way!](https://hashnode.com/posts/react-nodejs-and-jwt-authentication-the-right-way/5f4ff0aec48c6b29cd2ecd0a)
