Browse Source

fix AuthServiceProvider.php

pull/2/head
mahdihty 4 years ago
parent
commit
95b899843b
  1. 3
      app/Providers/AuthServiceProvider.php
  2. 2
      routes/api.php

3
app/Providers/AuthServiceProvider.php

@ -30,7 +30,8 @@ class AuthServiceProvider extends ServiceProvider
$this->app['request']->mixin(new RequestMixin);
$this->app['request']->mixin(new BusinessInfoRequestMixin);
$this->app['auth']->viaRequest('api', function ($request) {
$this->app['auth']->viaRequest('token', function ($request) {
if ($request->bearerToken() === null) {
return null;
}

2
routes/api.php

@ -31,7 +31,7 @@ $router->group(['prefix' => 'auth'], function () use ($router) {
$router->get('google/callback', 'AuthController@handleGoogleCallback');
});
$router->group(['prefix' => 'businesses'], function () use ($router) {
$router->group(['prefix' => 'businesses', 'middleware' => 'auth:api'], function () use ($router) {
$router->get('/', 'BusinessController@index');
$router->post('/', 'BusinessController@store');

Loading…
Cancel
Save