Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Commit

Permalink
Update LaravelKinveyAuthServiceProvider.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jhariani committed Oct 23, 2014
1 parent fc3866b commit b21db42
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/GovTribe/LaravelKinvey/LaravelKinveyAuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,7 @@ public function registerEvents()
//Store the Kinvey auth token in the user's session, and clear it on logout.
Event::listen('auth.login', function($user)
{
// User logged in via an OAuth provider, we need to log them into Kinvey.
if (!isset($user->_kmd['authtoken']))
{
$credentials = [
'_socialIdentity' => $user->_socialIdentity,
];

$kinveyResponse = $this->app['kinvey']->loginOAuth($credentials);
$kinveyAuthToken = $kinveyResponse['_kmd']['authtoken'];
}
// User logged in directly via Kinvey.
else $kinveyAuthToken = $user->_kmd['authtoken'];

Session::put('kinvey', $kinveyAuthToken);
Session::put('kinvey', $user->_kmd['authtoken']);
});

Event::listen('auth.logout', function($user)
Expand Down

0 comments on commit b21db42

Please sign in to comment.