Skip to content

Commit

Permalink
Change "enable_auth" to "auth"
Browse files Browse the repository at this point in the history
Specify your own auth guard to use for the api
  • Loading branch information
MichaelBelgium committed Oct 6, 2021
1 parent 9c02676 commit 1c04cc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions config/youtube-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@

/*
|--------------------------------------------------------------------------
| Enable authentication
| Set authentication
|--------------------------------------------------------------------------
|
| If true, middleware 'auth:api' will be used for api routes
| If not null, it'll attempt to use the defined authentication guard for api routes
|
*/

'enable_auth' => false,
'auth' => null,

/*
|--------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/YoutubeAPIServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function register()
private function loadRoutes() {
$apiMiddleware = ['api'];

if(config('youtube-api.enable_auth', false)) {
$apiMiddleware[] = 'auth:api';
if(config('youtube-api.auth') !== null) {
$apiMiddleware[] = 'auth:' . config('youtube-api.auth');
}

if(config('youtube-api.ratelimiter') !== null) {
Expand Down

0 comments on commit 1c04cc7

Please sign in to comment.