You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project I'm working on is using Laravel, React, and Inertia.
I've setup axios with an interceptor so that all components will pass a Bearer token in the headers on every request. I then have a middleware that checks this token to determine who a request is coming from, and uses it to set API credentials for an external service. The external service sends back data, which I pass to the front-end as an Inertia Response. Also, my app is running inside a frame since it's embedded.
All normal Link requests and full-page reloads work as expected since the requests are being made via axios. The problem occurs when right-click-reloading the frame. Since the request to reload recalls the endpoint, but not via axios, the authorization header is lost and the auth fails.
Does anyone know of a way I can have the headers maintained when someone reloads the frame this way? I could just re-authorize the user, but I'd like to make sure there's isn't something I'm missing first.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The project I'm working on is using Laravel, React, and Inertia.
I've setup axios with an interceptor so that all components will pass a Bearer token in the headers on every request. I then have a middleware that checks this token to determine who a request is coming from, and uses it to set API credentials for an external service. The external service sends back data, which I pass to the front-end as an Inertia Response. Also, my app is running inside a frame since it's embedded.
All normal Link requests and full-page reloads work as expected since the requests are being made via axios. The problem occurs when right-click-reloading the frame. Since the request to reload recalls the endpoint, but not via axios, the authorization header is lost and the auth fails.
Does anyone know of a way I can have the headers maintained when someone reloads the frame this way? I could just re-authorize the user, but I'd like to make sure there's isn't something I'm missing first.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions