Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Add callback url to the configuration file.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla committed Nov 27, 2014
1 parent 7443625 commit 8e303d0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
16 changes: 13 additions & 3 deletions src/Vinkla/Instagram/InstagramServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,22 @@ public function register()
// Register 'Instagram' instance container to our Instagram object.
$this->app->bindShared('Vinkla\Instagram\Contracts\Instagram', function($app)
{
return new Instagram(
if (
empty($app['config']['instagram::client_secret']) &&
empty($app['config']['instagram::callback_url'])
)
{
return new Instagram($app['config']['instagram::client_id']);
}

return new Instagram([
$app['config']['instagram::client_id'],
$app['config']['instagram::client_secret'],
$app['config']['instagram::callback']
);
$app['config']['instagram::callback_url']
]);
});
}

/**
* Bootstrap the application events.
*
Expand All @@ -37,6 +46,7 @@ public function boot()
{
$this->package('vinkla/instagram');
}

/**
* Get the services provided by the provider.
*
Expand Down
20 changes: 17 additions & 3 deletions src/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
|--------------------------------------------------------------------------
|
| Your applications client identifier. Used when generating authentication
| tokens and to receive your authorization code. The client identifier
| tokens and to receive your authorization code. This must always be set
| to fetch data from Instagram.
|
*/

Expand All @@ -20,10 +21,23 @@
|--------------------------------------------------------------------------
|
| Your applications client secret. Used when generating authentication
| tokens and to receive your authorization code.
| tokens and to receive your authorization code. Leave this NULL if you
| only are going to fetch public data.
|
*/

'client_secret' => ''
'client_secret' => null,

/*
|--------------------------------------------------------------------------
| Callback URL
|--------------------------------------------------------------------------
|
| Your applications callback url. Used to authorize users and generating
| tokens. Leave this NULL if you only are going to fetch public data.
|
*/

'callback_url' => null

];

0 comments on commit 8e303d0

Please sign in to comment.