diff options
Diffstat (limited to 'routes')
-rw-r--r--[-rwxr-xr-x] | routes/api.php | 6 | ||||
-rw-r--r--[-rwxr-xr-x] | routes/channels.php | 10 | ||||
-rw-r--r--[-rwxr-xr-x] | routes/console.php | 0 | ||||
-rwxr-xr-x | routes/keys.php | 18 | ||||
-rw-r--r--[-rwxr-xr-x] | routes/web.php | 20 |
5 files changed, 11 insertions, 43 deletions
diff --git a/routes/api.php b/routes/api.php index 9471c3a..c641ca5 100755..100644 --- a/routes/api.php +++ b/routes/api.php @@ -11,8 +11,8 @@ use Illuminate\Http\Request; | routes are loaded by the RouteServiceProvider within a group which | is assigned the "api" middleware group. Enjoy building your API! | - */ +*/ -Route::middleware('auth:api', 'throttle:30')->group(function() { - Route::get('/user', ['as' => 'GetUserData', 'uses' => 'ApiController@getUserData']); +Route::middleware('auth:api')->get('/user', function (Request $request) { + return $request->user(); }); diff --git a/routes/channels.php b/routes/channels.php index 109904c..f16a20b 100755..100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -9,12 +9,8 @@ | application supports. The given channel authorization callbacks are | used to check if an authenticated user can listen to the channel. | - */ +*/ -// Broadcast::channel('App.User.{id}', function ($user, $id) { -// return (int) $user->id === (int) $id; -// }); - -Broadcast::channel('chat', function ($user) { - return Auth::check(); +Broadcast::channel('App.User.{id}', function ($user, $id) { + return (int) $user->id === (int) $id; }); diff --git a/routes/console.php b/routes/console.php index 75dd0cd..75dd0cd 100755..100644 --- a/routes/console.php +++ b/routes/console.php diff --git a/routes/keys.php b/routes/keys.php deleted file mode 100755 index 52c7b3a..0000000 --- a/routes/keys.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/* -|-------------------------------------------------------------------------- -| Routes for public keys -|-------------------------------------------------------------------------- -| -| Here is where you can register web routes for your application. These -| routes are loaded by the RouteServiceProvider within a group which -| contains the "web" middleware group. Now create something great! -| - */ -Auth::routes(); -Route::middleware('auth', 'throttle:30') // throttle to 30 per minute - ->group(function () { - Route::get('keys/cookie/public/', 'PublicKeyController@setUsersKeyByCookie'); - Route::get('keys/public/{user_id}', 'PublicKeyController@getUsersKey'); - Route::post('keys/public', 'PublicKeyController@setUsersKey'); - }); diff --git a/routes/web.php b/routes/web.php index 41725f2..5eb1b7d 100755..100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,4 +1,5 @@ <?php + /* |-------------------------------------------------------------------------- | Web Routes @@ -8,19 +9,8 @@ | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | - */ - -// Route should not use authentication! -Route::get('verify/email/{token}', 'Auth\RegisterController@verifyEmail'); - -Auth::routes(); -Route::middleware('auth', 'throttle:30') // throttle to 30 per minute - ->group(function () { - Route::get('/', ['as' => 'MessageChat', 'uses' => 'SocketController@writeMessage']); - Route::get('avatar/{user_id}', ['as' => 'GetAvatar', 'uses' => 'ImageController@getAvatar']); - Route::get('profile', ['as' => 'GetProfileSettings', 'uses' => 'UserController@Profile']); - Route::get('admin', ['as' => 'GetAdminDashboard', 'uses' => 'AdminController@Dashboard']); +*/ - Route::post('avatar', ['as' => 'UpdateAvatar', 'uses' => 'UserController@updateAvatar']); - Route::post('sendMessage', ['as' => 'SendMessage', 'uses' => 'SocketController@sendMessage']); - }); +Route::get('/', function () { + return "BEAM-Messenger backend"; +}); |