File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src/Authentication/Authenticators
tests/Authentication/Authenticators Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,10 @@ public function check(array $credentials): Result
125125 }
126126
127127 $ token ->last_used_at = Time::now ()->format ('Y-m-d H:i:s ' );
128- $ identityModel ->save ($ token );
128+
129+ if ($ token ->hasChanged ()) {
130+ $ identityModel ->save ($ token );
131+ }
129132
130133 // Ensure the token is set as the current token
131134 $ user = $ token ->user ();
Original file line number Diff line number Diff line change @@ -155,6 +155,9 @@ public function testCheckSuccess(): void
155155
156156 $ updatedToken = $ result ->extraInfo ()->currentAccessToken ();
157157 $ this ->assertNotEmpty ($ updatedToken ->last_used_at );
158+
159+ // Checking token in the same second does not throw "DataException : There is no data to update."
160+ $ this ->auth ->check (['token ' => $ token ->raw_token ]);
158161 }
159162
160163 public function testAttemptCannotFindUser (): void
You can’t perform that action at this time.
0 commit comments