I am implementing an authentication for my web app and decided to use tokens for authentication. My idea is the following: