This commit is contained in:
Marcel Pociot 2018-11-27 12:13:24 +01:00
parent c1cd4a520e
commit 7270553c2a
2 changed files with 3 additions and 3 deletions

View File

@ -106,7 +106,7 @@
wsHost: window.location.hostname, wsHost: window.location.hostname,
wsPort: this.port, wsPort: this.port,
disableStats: true, disableStats: true,
authEndpoint: '{{ config('websockets.dashboard.path') }}/auth', authEndpoint: '/{{ request()->path() }}/auth',
auth: { auth: {
headers: { headers: {
'X-CSRF-Token': "{{ csrf_token() }}" 'X-CSRF-Token': "{{ csrf_token() }}"
@ -171,7 +171,7 @@
}, },
sendEvent() { sendEvent() {
$.post('{{ config('websockets.dashboard.path') }}/event', { $.post('/{{ request()->path() }}/event', {
_token: '{{ csrf_token() }}', _token: '{{ csrf_token() }}',
key: this.client.appKey, key: this.client.appKey,
secret: this.client.appSecret, secret: this.client.appSecret,

View File

@ -54,7 +54,7 @@ class WebSocketsServiceProvider extends ServiceProvider
protected function registerRouteMacro() protected function registerRouteMacro()
{ {
Route::macro('websocketsDashboard', function($prefix = 'websockets') { Route::macro('webSocketsDashboard', function($prefix = 'websockets') {
Route::prefix($prefix)->namespace('\\')->middleware(Authorize::class)->group(function() { Route::prefix($prefix)->namespace('\\')->middleware(Authorize::class)->group(function() {
Route::get('/', ShowDashboard::class); Route::get('/', ShowDashboard::class);
Route::post('auth', AuthenticateDashboard::class); Route::post('auth', AuthenticateDashboard::class);