Answer the question
In order to leave comments, you need to log in
Why is there no access to remote url in react-admin?
I'm trying to get react-admin to log in to a remote server.
Did it like this:
git clone https://github.com/marmelab/react-admin.git && cd react-admin && make install
make build
make run-demo
login: ({ username, password }) => {
const request = new Request('https://mydomain.com/authenticate', {
method: 'POST',
body: JSON.stringify({ username, password }),
headers: new Headers({ 'Content-Type': 'application/json' }),
});
return fetch(request)
.then(response => {
if (response.status < 200 || response.status >= 300) {
throw new Error(response.statusText);
}
return response.json();
})
.then(({ token }) => {
localStorage.setItem('token', token);
});
},
// ...
Uncaught Error: No fallback response defined for GET to [object Request]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question