other-emerald
other-emerald•2y ago

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
ratty-blush
ratty-blush•2y ago
Hey @faize are you using @pankod/refine-simple-rest package as your data provider?
other-emerald
other-emeraldOP•2y ago
yes
ratty-blush
ratty-blush•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 like
other-emerald
other-emeraldOP•2y ago
Thanks a lot 🙂 Teşekkürler gerçekten

Did you find this page helpful?