I am from a traditional HTML, frontend JS, css background so I am a little suspicious of doing token authentication from the frontend.
So when user logs in, JWT will be generated from the backend and be sent to the client. From then on, I would store it in localStorage or sessionStorage to authenticate them 'at frontend' every time user attempts to access private routes. Coming from the traditional 'always client to server communication' I am wondering if this approach is very secure. (although I do know that the decoding of JWT is exactly the same process whether it happens in the backend or the frontend). So are there any additional security breach I should be considering when routing on the frontend as opposed to routing on the backend?
EDIT**
Also, would my secret not be exposed to everyone if I decode on the frontend?