Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/azat-co/practicalnode
/ authorize
Function
authorize
code/ch6/blog-everyauth/app.js:91–93 ·
view source on GitHub ↗
(req, res, next)
Source
from the content-addressed store, hash-verified
89
90
// Authorization Middleware
91
const
authorize = (req, res, next) => {
92
if
(req.session && req.session.admin) {
return
next() }
else
{
return
res.status(401).send() }
93
}
94
95
96
Callers
nothing calls this directly
Calls
1
next
Function · 0.50
Tested by
no test coverage detected