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

Function app

lib/handler/gcloud.js:21–42  ·  view source on GitHub ↗
(req, res, state)

Source from the content-addressed store, hash-verified

19 var store = Session(args.session)
20
21 async function app (req, res, state) {
22 var session = store(req, res)
23 var match = regex.exec(req.url)
24 if (!match) {
25 return {session}
26 }
27
28 var {location, session:sess, state} = await grant({
29 method: req.method,
30 params: {provider: match[1], override: match[2]},
31 query: qs.parse(req.query),
32 body: req.body,
33 state,
34 session: (await session.get()).grant
35 })
36
37 await session.set({grant: sess})
38
39 return location
40 ? (redirect(res, location, session), {session, redirect: true})
41 : {session, response: state.response || sess.response}
42 }
43
44 return app
45}

Callers

nothing calls this directly

Calls 2

grantFunction · 0.85
redirectFunction · 0.70

Tested by

no test coverage detected