Skip to content
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

(Fix) Helpdesk Route #3738

Merged
merged 1 commit into from
Apr 8, 2024
Merged

(Fix) Helpdesk Route #3738

merged 1 commit into from
Apr 8, 2024

Conversation

HDVinnie
Copy link
Collaborator

@HDVinnie HDVinnie commented Apr 8, 2024

No description provided.

@HDVinnie HDVinnie merged commit 3eb9db3 into 8.x.x Apr 8, 2024
10 checks passed
@HDVinnie HDVinnie deleted the Helpdesk branch April 8, 2024 23:18
Copy link
Collaborator

@Roardom Roardom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few questions:

  • Did this route error when accessed or did it magically bypass the middleware
  • If it magically bypassed, what can we do to prevent this from happening again?
    • Class strings
    • Write a phpstan dynamic return type extension
    • Other?

@HDVinnie
Copy link
Collaborator Author

HDVinnie commented Apr 8, 2024

Few questions:

  • Did this route error when accessed or did it magically bypass the middleware

  • If it magically bypassed, what can we do to prevent this from happening again?

    • Class strings
    • Write a phpstan dynamic return type extension
    • Other?

It threw an error that is_modo didn't exist.

Target class [is_modo] does not exist. at /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:914)

This is because it doesn't. The alias is just modo.

'modo' => Middleware\CheckForModo::class,

Using an alias is fine or could use class. See https://laravel.com/docs/10.x/middleware#assigning-middleware-to-routes

None the less it's fixed now and there was also check in controller so wasn't a security issue.

abort_unless($request->user()->group->is_modo, 403);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants