a copy from https://github.com/scotch-io/easy-node-authentication/tree/local