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:
parent
fef7ee75e8
commit
f338ee4101
1 changed files with 8 additions and 3 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Reference in a new issue