diff --git a/Authentication.php b/Authentication.php new file mode 100644 index 0000000..1c766bf --- /dev/null +++ b/Authentication.php @@ -0,0 +1,25 @@ +input('gql_session') === 'SUPER_SECRET_TOKEN') { + return "false"; + } + else { + return "true"; + } + + return $next($request); + } +} diff --git a/Plugin.php b/Plugin.php index ea7e1f8..d06519b 100644 --- a/Plugin.php +++ b/Plugin.php @@ -34,12 +34,17 @@ class Plugin extends PluginBase public function boot() { App::make('October\Rain\Support\ClassLoader')->addDirectories('graphql'); + $this->bootPackages(); + App::register(GraphqlServiceProvider::class); App::register(SubscriptionServiceProvider::class); + $this->app->singleton(DatabaseManager::class, function ($app) { return $app->make('db'); }); + \Illuminate\Support\Facades\Broadcast::routes(['prefix' => '', 'middleware' => 'GermanAirlinesVA\\Graphql\\Classes\\Authentication']); + require("channels/channels.php"); } public function bootPackages() diff --git a/channels/.channels.php.swp b/channels/.channels.php.swp new file mode 100644 index 0000000..b1f0ded Binary files /dev/null and b/channels/.channels.php.swp differ diff --git a/channels/channels.php b/channels/channels.php new file mode 100644 index 0000000..5abfaec --- /dev/null +++ b/channels/channels.php @@ -0,0 +1,18 @@ +input('gql_session') === 'SUPER_SECRET_TOKEN') { + return "false"; + } + else { + return "true"; + } + + return $next($request); + } +}