Last active
July 7, 2016 14:44
-
-
Save zenlor/450fb654bfa91ffe6231768ae75b7558 to your computer and use it in GitHub Desktop.
lispy js failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // People should take a look at lisp | |
| // this code would be much more readable | |
| exports.handler = function handler(request, reply) { | |
| const code = request.query.code; | |
| const state = request.query.state; | |
| const stateLink = (new Buffer(state, 'base64')).toString('utf8'); | |
| const key = getUserKey(state); | |
| const id = getId(state); | |
| getToken(key, | |
| id, | |
| code, | |
| state) | |
| .then(customer => | |
| reply.view('index', { customer, state: stateLink })) | |
| .catch(err => | |
| (isCodeExpired(err) | |
| // render `expired_code` for users waiting too long to login | |
| ? reply.view('expired_code') | |
| // Unknown error | |
| : reply(normalizeErrors(err)))); | |
| }; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment