Comments (6)
Hi, yes, you can do that.
At least if you're using admin-on-rest components in custom app. In this case you can add any headers in your rest-client.
from react-admin.
Yes you have to implement your own rest client
from react-admin.
i have followed the guides, created the react app and the admin panel.
there is a scala rest api server of mine, so i needed to write a custom rest client for that. I did as in the examples and for the sake of testing i put my custom header to the options variable in method convertRESTRequestToHTTP
. Like this;
options.headers['X-Auth-Token'] = token;
Then i used this custom rest client on the requests, like this;
<Admin restClient={scalaRestClient}> <Resource name="agents" list={AgentList}/> </Admin>
but there weren't this header on my reqeust when i open the chrome dev console and check the request (Also my api server returns unauthorized which should be happen when there were no or invalid header, i am sure token is valid)
I am new to the react so sorry for terms i used above.
from react-admin.
Can you put the rest client code on a codepen ?
from react-admin.
this is the rest client i am using, exactly same in the examples except the header part
from react-admin.
If you look at the fetch code you'll notice that setting authorization header will be handled for you, you just have to pass a user
option like this:
const token = "token";
const options = {
user: {
authenticated: true,
token,
},
};
from react-admin.
Related Issues (20)
- NumberInput's `onBlur` prop does not provide an event object HOT 2
- Add ability to customize query string format for lists HOT 5
- i want to show the received gmail in react js app
- AutoComplete choice listing issue when using useChoicesContext HOT 1
- react admin error with Menu.Item missing properties HOT 6
- storeKey prop is not passed to useRecordSelection hook inside useListController HOT 5
- useEditContext returns null for both values HOT 5
- Infinite loop occurs in page rendering when perPage is set to a negative number in List Component HOT 2
- Codemods are not included in ra-core v5
- Duplicate entries in documentation search HOT 2
- `<PasswordInput/>` or `<TextInput/>` has corrupted `validate` prop, if field is handled with `disabled` prop HOT 4
- Auth provider login Promise rejection with "message" doesn't trigger notification message HOT 1
- When we use useRedirect hook to go back to a List Component, the pagination is reseted to page 1
- <AutocompleteInput> and <AutocompleteInputArray> refetch choises passed from graphql HOT 1
- Fields inside the ArrayInput aren't set as dirty when built HOT 1
- When a form contains ArrayInput with large entries. It takes more than a minute for a form to be submitted. HOT 2
- Bug in Translation in post edit page showing (post "some text here") HOT 1
- Dark mode become default upgrading react-admin package HOT 1
- AutocompleteInput with ReferenceInput calling getList() two times after select on sugestion list HOT 1
- Clearing filters using setFilter({}) does not clear FilterLiveSearch text input
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-admin.