Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:dreamfactorysoftware/dsp-laravel…
Browse files Browse the repository at this point in the history
… into develop
  • Loading branch information
Lee Hicks committed Jun 23, 2015
2 parents c5ff929 + 94f1e2c commit 302cadc
Show file tree
Hide file tree
Showing 7 changed files with 479 additions and 97 deletions.
3 changes: 1 addition & 2 deletions app/Http/Controllers/Auth/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ public function postLogin(Request $request)
if ($this->auth->attempt($credentials, $request->has('remember'))) {
$user = \Auth::user();
$user->update(['last_login_date' => Carbon::now()->toDateTimeString()]);
Session::setUserInfo($user);
Session::forgetApiKeys();
Session::setUserInfo($user->toArray());

return redirect()->intended($this->redirectPath());
}
Expand Down
12 changes: 6 additions & 6 deletions app/Http/Controllers/SplashController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Carbon\Carbon;
use DreamFactory\Core\OAuth\Services\BaseOAuthService;
use DreamFactory\Core\Utility\ServiceHandler;
use DreamFactory\Core\Models\User as DspUser;
use DreamFactory\Core\ADLdap\Services\LDAP as LdapService;
use DreamFactory\Core\ADLdap\Contracts\Provider as ADLdapProvider;
use DreamFactory\Core\Utility\Session;
Expand Down Expand Up @@ -80,11 +79,11 @@ public static function handleADLdapLogin($provider)

if ($auth) {
$ldapUser = $driver->getUser();

$user = DspUser::createShadowADLdapUser($ldapUser, $service);
$user = $service->createShadowADLdapUser($ldapUser);
$user->update(['last_login_date' => Carbon::now()->toDateTimeString()]);

\Auth::login($user, \Request::has('remember'));
Session::setUserInfo($user->toArray());

return redirect()->intended(env('LANDING_PAGE', '/launchpad'));
}
Expand Down Expand Up @@ -119,10 +118,11 @@ public function handleOAuthCallback($serviceName)
/** @var User $user */
$user = $driver->user();

$dspUser = DspUser::createShadowOAuthUser($user, $service);
$dspUser->update(['last_login_date' => Carbon::now()->toDateTimeString()]);
$dfUser = $service->createShadowOAuthUser($user);
$dfUser->update(['last_login_date' => Carbon::now()->toDateTimeString()]);

\Auth::login($dspUser);
\Auth::login($dfUser);
Session::setUserInfo($dfUser->toArray());

if (\Request::ajax()) {
return ['success' => true, 'session_id' => Session::getId()];
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
],
"require": {
"laravel/framework": "5.0.*",
"tymon/jwt-auth": "0.5.*",
"dreamfactory/dsp-admin-app": "dev-develop as dev-master",
"dreamfactory/df-core": "dev-develop as dev-master",
"dreamfactory/df-aws": "dev-develop as dev-master",
Expand Down
Loading

0 comments on commit 302cadc

Please sign in to comment.