title: How to verify an access token in react side? Isnt it dangerous?
body: <p>Currently I have a backend where I am able to verify access tokens with this simple function:</p>
  
  <pre class="lang-js prettyprint-override"><code>const { verify } = require("jsonwebtoken");
  
  const isAuth = req =&gt; {
    const authorization = req.headers["authorization"];
    if (!authorization) throw new Error("You need to login");
  
    const token = authorization.split(" ")[1]; //Bearer token123123jjjjasd , we get the token value
    const { userId } = verify(token, process.env.ACCESS_TOKEN_SECRET);
    return userId;
  };
  
  module.exports = {
    isAuth
  };
  </code></pre>
  
  <p>But what about doing that in the front side / react to protect my routes? Isn't it dangerous to store the secret in my front end? 
  Should i create a verification route in my backend and send there the access tokens and return true if valid, or else false? Would that be secure?</p>