MCPcopy
hub / github.com/simov/grant / handler

Function handler

lib/handler/fastify.js:27–44  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

25 })
26
27 async function handler (req, res) {
28 if (!req.session) {
29 throw new Error('Grant: register session plugin first')
30 }
31
32 var {location, session, state} = await grant({
33 method: req.method,
34 params: req.params,
35 query: qs.parse(req.query),
36 body: qs.parse(req.body),
37 state: req.grant,
38 session: req.session.grant,
39 })
40
41 req.session.grant = session
42 res.grant = state
43 return location ? res.redirect(location) : res.send()
44 }
45
46 next()
47 }

Callers 1

grant.jsFile · 0.85

Calls 1

grantFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…