So I have a REST API and some socket APIs which use a common token validation module. Here are the things that the token module does:
function tokenManager()