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

Model not working with generators #41

Open garytryan opened 8 years ago

garytryan commented 8 years ago

using version: 1.0.1

Following the examples exactly, even resorted to just copy/pasting. Doesn't seem to work at all when using generators for the model. Switched to functions, that take a callback and everything is fine.

lan-nguyen91 commented 8 years ago

Correct, if you want to use async/promise base manner using yield/await in generator, you have to run with babel. Migration of the code from 2.x to 3.x mentioned about this in the documentation. https://github.com/oauthjs/node-oauth2-server/wiki/Migrating-from-2.x-to-3.x

garytryan commented 8 years ago

Right, got it. Thanks @lan-nguyen91