ReturnIfAuthenticated returning Null? #44182
Unanswered
BrekiTomasson
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Don't want to open a bug report about this since it's not technically a bug, rather a weird scenario I've encountered when adding more strict typing to my project.
Description:
Using the
RedirectIfAuthenticated
file available in thelaravel/laravel
framework, I decided to adddeclare(strict_types = 1);
to the top of the file and define the return type ofhandle()
by adding: Response|RedirectResponse
, the two return values suggested by the PHP DocBlock..What I'm noticing now, however, is that the logs are sometimes getting:
I haven't been able to reliably reproduce this, however. The web server logs suggest that this happens when GoogleBot is scraping the site, with the HTTP code 500 being thrown during
"POST /livewire/message/toasts HTTP/1.1"
I've looked through the code for the package usernotnull/tall-toasts and can't find any reason why
RedirectIfAuthenticated
would have any problems with it, however, so I'm not sure if that part of it is significant.While not technically a bug, it is curious ... So does anybody have any ideas as to why
RedirectIfAuthenticated
would returnnull
in certain scenarios and why this possible return value is not already covered by the PHP DocBlock?Beta Was this translation helpful? Give feedback.
All reactions