diff --git a/src/Lumen/ServiceProvider.php b/src/Lumen/ServiceProvider.php new file mode 100644 index 0000000..a29073e --- /dev/null +++ b/src/Lumen/ServiceProvider.php @@ -0,0 +1,29 @@ +publishes([$this->configPath() => $this->appConfigPath('sympla.php')]); + + $auth = $this->app->make('auth'); + + $auth->provider('oauth', function ($app, array $config) { + return new OAuthUserProvider( + $app->make('sympla.oauth.password_client'), + $config, + $app->make('request') + ); + }); + } + + protected function appConfigPath($path) + { + return app()->basePath() . '/config' . ($path ? '/' . $path : $path); + } +}