refactor and test passport.js from init-routes