adding header to DataProvider
hi! I am currently try to make a dashboard but I get stuck. My problem is adding header to dataProvider as I see I can't add directly so I use useCustom hook but I get error. So I have to add header to access my data what should I do?
4 Replies
rival-black•2y ago
Hey @faize are you using
@pankod/refine-simple-rest
package as your data provider?wise-white•2y ago
yes
rival-black•2y ago
Check out this auth provider doc https://refine.dev/docs/api-reference/core/providers/auth-provider/#setting-authorization-credentials which implements passing a custom headers to the data provider.
@pankod/refine-simple-rest
data provider accepts a custom axios instance in its second parameter which you can customize as you likewise-white•2y ago
Thanks a lot 🙂 Teşekkürler gerçekten