mirror of
https://github.com/grokability/snipe-it.git
synced 2026-03-12 17:52:00 +08:00
Merge pull request #18524 from ubc-cpsc/fix/subpath-livewire-prefix
Fix Livewire and Passport routes for subpath hosting
This commit is contained in:
@@ -21,12 +21,18 @@ class LivewireServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
Livewire::setUpdateRoute(function ($handle) {
|
||||
return Route::post('/' . config('livewire.url_prefix') . '/livewire/update', $handle);
|
||||
$prefix = trim((string) config('livewire.url_prefix', ''), '/');
|
||||
if ($prefix === '') {
|
||||
$prefix = trim((string) parse_url(config('app.url'), PHP_URL_PATH), '/');
|
||||
}
|
||||
$prefix = $prefix === '' ? '' : '/' . $prefix;
|
||||
|
||||
Livewire::setUpdateRoute(function ($handle) use ($prefix) {
|
||||
return Route::post($prefix . '/livewire/update', $handle);
|
||||
});
|
||||
|
||||
Livewire::setScriptRoute(function ($handle) {
|
||||
return Route::get('/' . config('livewire.url_prefix') . '/livewire/livewire.js', $handle);
|
||||
Livewire::setScriptRoute(function ($handle) use ($prefix) {
|
||||
return Route::get($prefix . '/livewire/livewire.js', $handle);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<div class="buttons">
|
||||
<!-- Authorize Button -->
|
||||
<form method="post" action="/oauth/authorize">
|
||||
<form method="post" action="{{ url('/oauth/authorize') }}">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<input type="hidden" name="state" value="{{ $request->state }}">
|
||||
@@ -73,7 +73,7 @@
|
||||
</form>
|
||||
|
||||
<!-- Cancel Button -->
|
||||
<form method="post" action="/oauth/authorize">
|
||||
<form method="post" action="{{ url('/oauth/authorize') }}">
|
||||
{{ csrf_field() }}
|
||||
{{ method_field('DELETE') }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user