redux-saga-social-login
This is an example on how to implement Facebook and Google login with redux-saga
It took me a while to figure it out. I'm just putting this code here so I can help other people since I've never found anything similar.
Feel free to open an issue or send a PR if you find a bug or think something could be written in a different way.
This project was created with ARc/redux. Take a look there if you want to learn more about the project's structure.
Download
Just clone the repository and remove the .git
folder:
$ git clone https://github.com/diegohaz/redux-saga-social-login
$ cd redux-saga-social-login
$ rm -rf .git
$ npm install # or yarn
Usage
You need to grab a Google Client ID and a Facebook App ID and put them into src/containers/App.js
:
const googleClientId = 'GOOGLE_CLIENT_ID.apps.googleusercontent.com'
const facebookAppId = 'FACEBOOK_APP_ID'
Then, just use npm start
and open http://localhost:3000
Sagas are located in src/store/social/sagas.js
.
License
MIT Β© Diego Haz