(req, res)
| 76 | |
| 77 | // handle authorisation requests |
| 78 | function authHandler(req, res){ |
| 79 | if (req.method === 'POST') { |
| 80 | var body = ''; |
| 81 | req.on('data', function (data) { |
| 82 | body += data; |
| 83 | }).on('end', function () { |
| 84 | var post = qs.parse(body); |
| 85 | if(post.username && post.username === u.un && post.password && post.password === u.pw) { |
| 86 | return authSuccess(req, res); |
| 87 | } else { |
| 88 | return authFail(res); |
| 89 | } |
| 90 | }); |
| 91 | } else { |
| 92 | return authFail(res); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | function verify(token) { |
| 97 | var decoded = false; |
nothing calls this directly
no test coverage detected