restrict() — express Function Reference
Architecture documentation for the restrict() function in index.js from the express codebase.
Entity Profile
Dependency Diagram
graph TD 41baa914_4a30_20d2_d192_21ddc8380c41["restrict()"] 4924fa15_e8b8_3b95_7bfd_02ee7793dfc4["index.js"] 41baa914_4a30_20d2_d192_21ddc8380c41 -->|defined in| 4924fa15_e8b8_3b95_7bfd_02ee7793dfc4 style 41baa914_4a30_20d2_d192_21ddc8380c41 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
examples/auth/index.js lines 75–82
function restrict(req, res, next) {
if (req.session.user) {
next();
} else {
req.session.error = 'Access denied!';
res.redirect('/login');
}
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does restrict() do?
restrict() is a function in the express codebase, defined in examples/auth/index.js.
Where is restrict() defined?
restrict() is defined in examples/auth/index.js at line 75.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free