From 49d60edac9b5179fb23a9fe9b374e6c2b5289299 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 16 Jun 2019 16:12:39 -0600 Subject: [PATCH] Update AuthLogin listener --- app/Listeners/AuthLogin.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/Listeners/AuthLogin.php b/app/Listeners/AuthLogin.php index f2e258e90..317ad12f7 100644 --- a/app/Listeners/AuthLogin.php +++ b/app/Listeners/AuthLogin.php @@ -41,7 +41,7 @@ class AuthLogin protected function userProfile($user) { if (empty($user->profile)) { - $profile = DB::transaction(function() use($user) { + DB::transaction(function() use($user) { $profile = new Profile(); $profile->user_id = $user->id; $profile->username = $user->username; @@ -59,12 +59,6 @@ class AuthLogin $profile->private_key = $pki_private; $profile->public_key = $pki_public; $profile->save(); - return $profile; - }); - DB::transaction(function() use($user, $profile) { - $user = User::findOrFail($user->id); - $user->profile_id = $profile->id; - $user->save(); CreateAvatar::dispatch($profile); });