bramus / bramus/router

No executing middleware

Open
#210 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
1.1k
Forks
236
PR merge metrics
No merged PRs in 30d

Description

I tryed to execute like the documentation

$router->before('GET|POST', '/admin/.*', function() {
if (!isset($_SESSION['user'])) {
header('location: /auth/login');
exit();
}
});

but isnt working the request goes direct into private side of application without check if user has access and is loged

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the documented before('GET|POST', '/admin/.*', ...) middleware example and tracing request dispatch for an /admin/ URL. Confirm whether the middleware callback runs before the protected request; done means unauthenticated requests are redirected to /auth/login instead of reaching the private application.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.