Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

stefanbauer's avatar

Username of BasicAuth is empty in Request of Middleware

Hi Guys,

quick question: Am i doing something wrong? I have a middleware, and in the middleware i just call dd($request->getUser()); in the handle method. When i send then an request with username and password, it is always empty. Any ideas?

0 likes
3 replies
stefanbauer's avatar

@bestmomo : Tried it already, same result: null @usman : I also read about that, and thought that this is the problem. But: I have PHP running as module.

Any further ideas? :)

Please or to participate in this conversation.