How to access Next Auth session or jwt from axios interceptor

my goal is to add the authorization header on the interceptor without doing it manually on every request except the function getServer() returns null and useSession is only used on the client obviously and the getServerSession needs access to the context
1 Reply
Shoodey
Shoodey16mo ago
I know i dont answer the question, but why are you using axios? - do your external api calls using fetch() from trpc (server side) where you have all your session info

Did you find this page helpful?