#Auth::check() - just check - no redirect

4 messages · Page 1 of 1 (latest)

severe kite
#

I'm currently building my own guard to connect to a legacy application. For various reasons, I want an Auth:check() to result in a 403 without a redirect. Where is the built-in behavior of redirecting to /login controlled? Where can I customize the behavior for a specific guard?

potent token
#

Auth::check() doesn’t perform a redirect, it just returns true or false. So might be worth giving a bit more detail about what you’re doing

severe kite
#

Sometimes you have to think about things for a while to recognize your mistake. Of course, Route() -> middleware() does the redirect. Thanks for the food for thought.

Still, it would be interesting to know how I can control the behavior of Route(), what happens when Auth::check() === false.

lean depot
#

There is a way to define where laravel takes the user too. If you want something custom define your own middleware