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!
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!
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);
}
strapi login api location
node_modules/strapi-plugin-users-permissions/controllers/Auth.js
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us