0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

fix: login with fetch

This commit is contained in:
Juan Picado @jotadeveloper 2018-03-21 06:59:20 +01:00
parent fef7ee75e8
commit f338ee4101
No known key found for this signature in database
GPG key ID: 18AC54485952D158

View file

@ -62,10 +62,15 @@ export default class Header extends React.Component {
}
try {
const credentials = {
username: this.state.username,
password: this.state.password
};
let resp = await API.request(`login`, 'POST', {
data: {
username: this.state.username,
password: this.state.password
body: JSON.stringify(credentials),
headers: {
Accept: 'application/json',
'Content-Type': 'application/json'
}
}).then((response) => response.json());