renoki-co / jetstream-cashier-billing-portal

Cashierstream is a simple Spark alternative written for Laravel Jetstream, with the super-power of tracking plan quotas, like seats or projects number on a per-plan basis
Apache License 2.0
163 stars 20 forks source link

Prevent cors erros from redirects #9

Closed a21ns1g4ts closed 3 years ago

a21ns1g4ts commented 3 years ago

Why use Redirect instead Inertia::location() ? Why use response('', 409)->header('X-Inertia-Location', $url) if response('', 409)->header('X-Inertia-Location', $url)is equals Inertia::location($url)? Why the $asResponse ? if

  return $asResponse
            ? response('', 409)->header('X-Inertia-Location', $url)
            : Redirect::to($url);

Always goes return: Redirect::to($url).

Bad things can happen if we combine $inertia.visit with: https://github.com/renoki-co/jetstream-cashier-billing-portal/blob/be606052b5b0ccb952e81313a4d7f119342c74d2/src/Http/Controllers/Inertia/BillingController.php#L41 image

What to do to prevent evetuals cors erros ? Redirect::to($url) works in your installation ?

rennokki commented 3 years ago

The feature was before this: https://github.com/inertiajs/inertia/issues/99#issuecomment-702823742

rennokki commented 3 years ago

The update (either 2.x or 3.x) requires Jetstream ^2.3