Commit a9cb979
fix: auth plugin loginAs injection broken in 4.x (#5502)
* fix: return plugin-injected functions directly from container instead of wrapping in non-callable Proxy
The 4.x ESM migration changed Container.support(name) to always go through
the proxy, which wraps values in lazyLoad() — a Proxy designed for page
objects (property access), not callable functions. This broke the auth
plugin's loginAs/login injection since the returned Proxy has no apply trap.
Also fixes missing-key detection in inject.js (was never firing because
lazyLoad always returns a truthy Proxy).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* revert: inject.js missing-key check change that broke I injection
The `!(key in objects)` check used the proxy's `has` trap which doesn't
include keys added directly to container.support (like the Actor `I`
from createActor). Reverting to the original `!objects[key]` check.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: DavertMik <davert@testomat.io>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 86ea01e commit a9cb979
2 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| |||
600 | 602 | | |
601 | 603 | | |
602 | 604 | | |
| 605 | + | |
| 606 | + | |
603 | 607 | | |
604 | 608 | | |
605 | 609 | | |
| |||
614 | 618 | | |
615 | 619 | | |
616 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
617 | 624 | | |
618 | 625 | | |
619 | 626 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
290 | 301 | | |
291 | 302 | | |
292 | 303 | | |
| |||
0 commit comments