'Having Issues With Sending Passing Jwt Token To Axios Instance In GetServerSideProps in nextJS

Using a Laravel backend and sanctum for handling the PAT's

Main issue is that the gSSp runs before the react tree so im not able to access the localstorage or the context...

Tried using axios interceptor but not sure how to use it properly.

Yes i'm aware that it shouldn't be stored in the local storage, its a graded project and I needed to at least let it seem functional for presentation. But it needs to be hosted today and that's my main issue with identifying different users...

Any help would be appreciated...

Discord : Prøxïmïty#1506



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source