Say I generate a JWT from my back-end and send it to my front-end which stores it in local storage (or a cookie, etc). What is stopping someone from going into the browser dev tools, copying the token and using it on another computer while the token is still active (i.e. has not expired)?
Consider the following:
- Person 1 logs into the application and is given a JWT. That token is then stored in local storage.
- Person 1 leaves their computer for 10 minutes.
- Person 2 comes along and copies Person 1's JWT via the browser dev tools.
- Person 2 goes to another computer and pastes the JWT taken from Person 1 into their local storage.
Is it correct to say that in the scenario above that Person 2 is now able to act as Person 1 on the application? If so, how would you secure this? I feel like I'm missing a vital bit of information that I can't seem to find the answer to.