Skip to content

Commit

Permalink
Removed authenticated user (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
guandeng authored Dec 11, 2023
1 parent bb6a512 commit 33b3a12
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions src/IncomingEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,31 +147,7 @@ public function withFamilyHash(string $familyHash): static
*/
public function user($user = null): static
{
$authUser = null;
if (function_exists('auth')) {
$token = auth()->parseToken();

if ($token && auth()->check($token)) {
$authUser = auth()->user();
}
}

$user = $user ?: $authUser;

if (! is_null($user)) {
$this->content = array_merge($this->content, [
'user' => [
'id' => $user->getKey(),
'name' => $user->name ?? null,
'email' => $user->email ?? null,
],
]);

$this->tags(['Auth:' . $user->getKey()]);
}

$this->user = $user;

// to do
return $this;
}

Expand Down

0 comments on commit 33b3a12

Please sign in to comment.