You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Laravel Breeze in combination with a tenancy package. Because I changed the auth middleware to tenant.auth and forgot to change all occurrences, I was stuck for a long time with the following vague and unhelpful error message:
// Original:
Route::post('/confirm-password', [ConfirmablePasswordController::class, 'store'])
->middleware('auth')
;
// Should have been in my case:
Route::post('/confirm-password', [ConfirmablePasswordController::class, 'store'])
->middleware('tenant.auth')
;
Laravel should handle mismatched middleware better.
Addendum:
Apparently auth somehow still exist somewhere, which is why upon removing the period this same error message is not displayed:
Illuminate\Contracts\Container\BindingResolutionException
Target class [tenantauth] does not exist.
Either way, the aforementioned error is really vague and should be improved.
Addendum 2:
I thought perhaps it's because it would take auth in auth.basic, but commenting it out shows that that is not the case. I am not sure what else it could be.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Laravel Breeze in combination with a tenancy package. Because I changed the
auth
middleware totenant.auth
and forgot to change all occurrences, I was stuck for a long time with the following vague and unhelpful error message:The stack trace and context can be seen here: https://flareapp.io/share/Lm8EXGRP
Upon finding the page https://laravelquestions.com/2021/02/26/larvael-auth-middleware-illegal-offset-type/, I figured out after a while that my middleware is wrong:
Laravel should handle mismatched middleware better.
Addendum:
Apparently
auth
somehow still exist somewhere, which is why upon removing the period this same error message is not displayed:Either way, the aforementioned error is really vague and should be improved.
Addendum 2:
I thought perhaps it's because it would take
auth
inauth.basic
, but commenting it out shows that that is not the case. I am not sure what else it could be.Beta Was this translation helpful? Give feedback.
All reactions