koa-oauth-server icon indicating copy to clipboard operation
koa-oauth-server copied to clipboard

Model not working with generators

Open garytryan opened this issue 9 years ago • 2 comments

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.

garytryan avatar Apr 20 '16 17:04 garytryan

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

lan-nguyen91 avatar May 10 '16 15:05 lan-nguyen91

Right, got it. Thanks @lan-nguyen91

garytryan avatar May 10 '16 16:05 garytryan