strapi io facebook authentication example

Solutions on MaxInterview for strapi io facebook authentication example by the best coders in the world

showing results for - "strapi io facebook authentication example"
Sofie
28 Jan 2016
1componentDidMount() {
2  const { match: {params: { provider }}, location: { search } } = this.props;
3  const requestURL = `http://localhost:1337/auth/${provider}/callback${search}`;
4 
5 request(requestURL, { method: 'GET' })
6   .then((response) => {
7      auth.setToken(response.jwt, true);
8      auth.setUserInfo(response.user, true);
9      this.redirectUser('/');
10   }).catch(err => {
11      console.log(err.response.payload)
12      this.redirectUser('/auth/login');
13   });
14}
15
16redirectUser = (path) => {
17  this.props.history.push(path);
18}