oauthjs / express-oauth-server

Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with express in node.js
MIT License
484 stars 384 forks source link

Wrap functions in closure so this context works correctly. #36

Closed chainlink closed 8 years ago

chainlink commented 8 years ago

When using this function directly (not inside a node module) this does not get set correctly inside functions. This PR makes ExpressOAuthServer a proper closure, which corrects sets this inside the middleware functions.

chainlink commented 8 years ago

Tests fail due to changes to Node-OAuth-server, fixed in https://github.com/oauthjs/express-oauth-server/pull/35

maxtruxa commented 8 years ago

ExpressOAuthServer is not supposed to be a closure. It's a constructor.

The problem with this should be fixed once #19 is corrected and merged.

chainlink commented 8 years ago

Fixed in latest master thanks!