-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/FrameworkIntegration/Laravel/BattleNetOAuth2ServiceProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Depotwarehouse\OAuth2\Client\FrameworkIntegration\Laravel; | ||
|
||
|
||
use Depotwarehouse\OAuth2\Client\Provider\BattleNet; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
class BattleNetOAuth2ServiceProvider extends ServiceProvider { | ||
|
||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = false; | ||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->package('depotwarehouse/oauth2-bnet', null, __DIR__); | ||
$this->app->bind(BattleNet::class, function () { | ||
return new BattleNet([ | ||
'clientId' => \Config::get('oauth2-bnet::clientId'), | ||
'clientSecret' => \Config::get('oauth2-bnet::clientSecret'), | ||
'redirectUri' => \Config::get('oauth2-bnet::redirectUri'), | ||
]); | ||
}); | ||
} | ||
|
||
public function boot() | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() | ||
{ | ||
return array(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
return [ | ||
'clientId' => getenv('BNET_CLIENT_ID'), | ||
'clientSecret' => getenv('BNET_CLIENT_SECRET'), | ||
'redirectUri' => getenv("BNET_REDIRECT_URI") | ||
]; |