Commit 2c0df5b
committed
[BUGFIX] Skip bearer auth flow when Authorization header is absent
authenticateBearerToken() destructures the scheme and token from the
Authorization header. The previous guard returned early only when a
scheme was present but did not equal "bearer". For requests without
an Authorization header (or with an unparseable header that yields no
scheme), $scheme is null, the guard did not trigger, and the function
fell through to TokenRepository::findBackendUserIdByToken(null) which
raised a TypeError because the argument is typed as string.
Invert the guard so it also early-returns when the scheme is not a
string. Smallest possible change: keeps the same single-statement
structure and the same is_string() helper that was already used.1 parent 29c744c commit 2c0df5b
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
0 commit comments