I'm making my first node + express app and I'm using a npm module that makes calls to an external api.
I've a login page with a form where the user enters the credentials, which are then passed via post (ajax client-side, app.post server-side) and used to make the initial api call (using the npm module) which returns an auth token. All of the consequent api calls (using the npm module) are made using that token.
My question is: What is(/are) the best way(s) to handle that token ? Save it in a variable/object and export it, then require it on the js files where I need the token ? Use sessions (which would probably be a good idea to avoid asking the user to re-login) and store the token in that session ?