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
plain-purple•2y ago
Hey @faize are you using
@pankod/refine-simple-rest
package as your data provider?correct-apricot•2y ago
yes
plain-purple•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 likecorrect-apricot•2y ago
Thanks a lot 🙂 Teşekkürler gerçekten