From 4277d0b7c4d69721142b17fe0eb932688b126dea Mon Sep 17 00:00:00 2001 From: James LaChance Date: Wed, 27 Feb 2019 21:51:22 -0500 Subject: [PATCH] Change wasRecentlyCreated to false The core framework fixed this same bug with the core actingAs method but it seems it was missed for Passport! Check this PR for more details: https://github.com/laravel/framework/pull/25873 --- src/Passport.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Passport.php b/src/Passport.php index 1023486d1..4261aae30 100644 --- a/src/Passport.php +++ b/src/Passport.php @@ -389,6 +389,10 @@ public static function actingAs($user, $scopes = [], $guard = 'api') $user->withAccessToken($token); + if (isset($user->wasRecentlyCreated) && $user->wasRecentlyCreated) { + $user->wasRecentlyCreated = false; + } + app('auth')->guard($guard)->setUser($user); app('auth')->shouldUse($guard);