eastern-cyan
eastern-cyan•3y 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
harsh-harlequin
harsh-harlequin•3y ago
Hey @faize are you using @pankod/refine-simple-rest package as your data provider?
eastern-cyan
eastern-cyanOP•3y ago
yes
harsh-harlequin
harsh-harlequin•3y 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
eastern-cyan
eastern-cyanOP•3y ago
Thanks a lot 🙂 Teşekkürler gerçekten

Did you find this page helpful?