dd-trace-php icon indicating copy to clipboard operation
dd-trace-php copied to clipboard

Use \DDTrace\set_user() in its Laravel authentication module

Open bwoebi opened this issue 2 years ago • 3 comments

Description

Relates to #1909.

It has no tests yet, just to show off for now.

Readiness checklist

  • [ ] (only for Members) Changelog has been added to the release document.
  • [ ] Tests added for this feature/bug.

Reviewer checklist

  • [ ] Appropriate labels assigned.
  • [ ] Milestone is set.
  • [ ] Changelog has been added to the release document. For community contributors the reviewer is in charge of this task.

bwoebi avatar Feb 10 '23 11:02 bwoebi

Is the hook on SessionGuard::id() actually needed?

    public function id()
    {
        if ($this->loggedOut) {
            return;
        }

        return $this->user()
                    ? $this->user()->getAuthIdentifier()
                    : $this->session->get($this->getName());
    }

It just ends up calling SessionGuard::user() anyway, so likely just the hook on user() is needed?

NickStallman avatar Feb 10 '23 18:02 NickStallman

Indeed, it isn't :-)

bwoebi avatar Feb 10 '23 20:02 bwoebi