Boilerplate of Google Login with Express and Passport.
- Create your google account for development and register your app.
- Add Google Plus to your app account.
- Add
localhost:3000
to your app account. - Add
localhost:3000/auth/google/callback
to your app account for callback.
$ touch .env
$ echo 'GOOGLE_CLIENT_ID={YOUR_CLIENT_ID}' >> .env
$ echo 'GOOGLE_CLIENT_SECRET={YOUR_CLIENT_SECRET}' >> .env
$ echo 'MONGO_URL={YOUR_MONGO_URL}' >> .env
$ echo 'COOKIE_KEY={ANY_NAME_OR_NOTHING_IS_OK}' >> .env
$ echo 'COOKIE_EXPIRED_DAYS={ANY_NUMBER_OR_NOTHING_IS_OK}' >> .env
- localhost:3000/auth/google
- localhost:3000/api/user
- localhost:3000/api/logout