MCPcopy
hub / github.com/dwyl/learn-json-web-tokens / authSuccess

Function authSuccess

example/lib/helpers.js:64–72  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

62}
63
64function authSuccess(req, res) {
65 var token = generateAndStoreToken(req);
66
67 res.writeHead(200, {
68 'content-type': 'text/html',
69 'authorization': token
70 });
71 return res.end(restricted);
72}
73
74// lookup person in "database"
75var u = { un: 'masterbuilder', pw: 'itsnosecret' };

Callers 1

authHandlerFunction · 0.85

Calls 1

generateAndStoreTokenFunction · 0.85

Tested by

no test coverage detected