oauthjs / koa-oauth-server

Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with koa in node.js
212 stars 81 forks source link

Update model.js #34

Open vitaly-t opened 8 years ago

vitaly-t commented 8 years ago

your example was broken in so many places... I tried to fix it, following the logic I saw there, but the last one cannot even be fixed, its a contradiction - you return nothing from the query, and trying to process the result...

vitaly-t commented 8 years ago

Also, returning things like:

return users.length ? users[0] : false;

is generally a bad idea.

vitaly-t commented 8 years ago

Missed one thing, the last:

yield pg.none

should also become

yield db.none
ruimarinho commented 8 years ago

Thanks for the PR! I'll take a look at it during the weekend.