Commit 0533a6e7 authored by Wietse Kuipers's avatar Wietse Kuipers
Browse files

New login URL

parent 6cc55921
import * as types from './actionTypes';
const apiKey = 'AiYinaeng4juw1cae1eiLe2Adei2Ahbahda3AiRu';
export function loginSuccess(username, token) {
return {
type: types.LOGINSUCCESS,
......@@ -35,17 +33,16 @@ export function login(username, password) {
'Content-Type': 'application/json',
},
body: JSON.stringify({
apikey: apiKey,
username,
password,
}),
};
return fetch('http://localhost:8000/api/login', data)
return fetch('http://localhost:8000/api/token-auth', data)
.then(
response => response.json())
.then(
(responseJson) => {
if (responseJson.status === 'ok') {
if (responseJson.token) {
return dispatch(loginSuccess(username, responseJson.token));
}
return dispatch(loginFailure());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment