Answers for "strapi login api"

1

strapi login api

import axios from 'axios';

const { data } = await axios.post('http://localhost:1337/auth/local', {
  identifier: '[email protected]',
  password: 'strapi',
});

console.log(data);
  
        Copied to clipboard!
Posted by: Guest on September-24-2021
1

strapi.io facebook authentication example

componentDidMount() {
  const { match: {params: { provider }}, location: { search } } = this.props;
  const requestURL = `http://localhost:1337/auth/${provider}/callback${search}`;
 
 request(requestURL, { method: 'GET' })
   .then((response) => {
      auth.setToken(response.jwt, true);
      auth.setUserInfo(response.user, true);
      this.redirectUser('/');
   }).catch(err => {
      console.log(err.response.payload)
      this.redirectUser('/auth/login');
   });
}

redirectUser = (path) => {
  this.props.history.push(path);
}
Posted by: Guest on October-14-2020
0

strapi login api location

node_modules/strapi-plugin-users-permissions/controllers/Auth.js
Posted by: Guest on September-28-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language