-
Notifications
You must be signed in to change notification settings - Fork 34
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Jetstream & Custom auth guard #4683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please provide the full reproducing repository similar to https://github.com/nova-issues in order for us to debug the issue. |
@crynobone thanks for your reply.
I hope this clarifies better the issue. Thank you. |
This is not a Nova bug and you're using Jetstream incorrectly. Submit a request to Jetstream to support using multiple User model where one doesn't use Team feature when configured with Team feature. |
@crynobone thanks again for your response. Indeed it's not a bug of Nova but it seems Jetstream doesn't play well if I have a custom model for other purposes (in this case for Nova). Closing this and hopefully will find a solution. |
@crynobone I've been thinking that Nova could handle this situation easily. We just need a custom config to specify which middlewares we want to be removed from Nova routes. See below example: vendor/laravel/nova/src/PendingRouteRegistration.php Route::namespace('Laravel\Nova\Http\Controllers')
->domain(config('nova.domain', null))
->middleware(config('nova.middleware', []))
->withoutMiddleware(config('nova.withoutMiddleware', [])) <-- new addition config/nova.php 'withoutMiddleware' => [
\Laravel\Jetstream\Http\Middleware\ShareInertiaData::class,
], Same for This can help unload specific middlewares that are injected by other packages installed in Laravel. I think it would be a great solution not only for this specific case but for others too. What do you think? Thanks. |
information. This would be useful for application with multiple user providers and uses Inertia. As an example, this will fixes laravel/nova-issues#4683 Signed-off-by: Mior Muhammad Zaki <[email protected]>
…formation. (#1120) * Check current model supports HasTeams before trying to access team information. This would be useful for application with multiple user providers and uses Inertia. As an example, this will fixes laravel/nova-issues#4683 Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip * formatting Signed-off-by: Mior Muhammad Zaki <[email protected]> Co-authored-by: Taylor Otwell <[email protected]>
…formation. (#1120) * Check current model supports HasTeams before trying to access team information. This would be useful for application with multiple user providers and uses Inertia. As an example, this will fixes laravel/nova-issues#4683 Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip * formatting Signed-off-by: Mior Muhammad Zaki <[email protected]> Co-authored-by: Taylor Otwell <[email protected]>
…formation. (#1120) * Check current model supports HasTeams before trying to access team information. This would be useful for application with multiple user providers and uses Inertia. As an example, this will fixes laravel/nova-issues#4683 Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip * formatting Signed-off-by: Mior Muhammad Zaki <[email protected]> Co-authored-by: Taylor Otwell <[email protected]>
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Description:
If the application has JetStream installed and configured a custom auth guard with a provider eloquent (example:
App/Models/Admin
) when authenticating in Nova it throws an error:Which seems that in Nova the middleware
\Laravel\Jetstream\Http\Middleware\ShareInertiaData
is loaded too which causes the issue.Detailed steps to reproduce the issue on a fresh Nova installation:
The text was updated successfully, but these errors were encountered: