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
stormy-gold
stormy-gold2y ago
Hey @faize are you using @pankod/refine-simple-rest package as your data provider?
conscious-sapphire
conscious-sapphire2y ago
yes
stormy-gold
stormy-gold2y 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
conscious-sapphire
conscious-sapphire2y ago
Thanks a lot 🙂 Teşekkürler gerçekten