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

Bug: Filter is not work ! #4482

Closed
xgdd1987 opened this issue Mar 24, 2021 · 4 comments
Closed

Bug: Filter is not work ! #4482

xgdd1987 opened this issue Mar 24, 2021 · 4 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@xgdd1987
Copy link

Describe the bug

Filters do not intercept default controllers and methods .

CodeIgniter 4 version
4.1.1

code
Config/Filter.php :
public $filters = ['isLoggedIn' => ['before' => ['admin/*']]];

If I visit xxxx.com/admin , the filter will not intercept. Default page xxxx.com/admin/home/index Will be accessed.

Context

  • OS: [e.g. Windows 99]
  • Web server [e.g. Apache 1.2.3]
  • PHP version [e.g. 6.5.4]
@xgdd1987 xgdd1987 added the bug Verified issues on the current code behavior or pull requests that will fix them label Mar 24, 2021
@MGatner
Copy link
Member

MGatner commented Mar 24, 2021

Filters are very literal matches. If you have admin/* it will NOT match admin because there is no trailing slash on URI segments. Try changing your filter to apply to admin* and let me know if that fixes it.

@MGatner
Copy link
Member

MGatner commented Mar 25, 2021

@xgdd1987 please confirm this is an actual issue and not just an implementation mistake.

@xgdd1987
Copy link
Author

When accessing the default page /admin,can the framework get the default controller and method /admin/welcome/index, and then filter it?

@paulbalandan
Copy link
Member

No word from the OP. This seems to be not a framework issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

3 participants