Removed fiber wrapper around OAuth middleware. (#9740)

* Removed fiber wrapper around OAuth middleware.

With commit 3b18863, connect handlers are guaranteed to run in a fiber, making the fiber wrapper in the OAuth middleware superfluous. Additionally, because it manually wraps the middleware in a Fiber directly, it is losing access to the properties stored in the existing fiber (meteor/meteor-feature-requests#156).

* Bump oauth Meteor package version to 1.2.2.
This commit is contained in:
MKRazz
2018-03-21 12:05:13 -04:00
committed by Ben Newman
parent f9050936fa
commit 857edc2079
2 changed files with 3 additions and 9 deletions

View File

@@ -139,14 +139,6 @@ OAuth._checkRedirectUrlOrigin = function (redirectUrl) {
// Listen to incoming OAuth http requests // Listen to incoming OAuth http requests
WebApp.connectHandlers.use(function(req, res, next) {
// Need to create a Fiber since we're using synchronous http calls and nothing
// else is wrapping this in a fiber automatically
Fiber(function () {
middleware(req, res, next);
}).run();
});
var middleware = function (req, res, next) { var middleware = function (req, res, next) {
// Make sure to catch any exceptions because otherwise we'd crash // Make sure to catch any exceptions because otherwise we'd crash
// the runner // the runner
@@ -207,6 +199,8 @@ var middleware = function (req, res, next) {
} }
}; };
WebApp.connectHandlers.use(middleware);
OAuthTest.middleware = middleware; OAuthTest.middleware = middleware;
// Handle /_oauth/* paths and extract the service name. // Handle /_oauth/* paths and extract the service name.

View File

@@ -1,6 +1,6 @@
Package.describe({ Package.describe({
summary: "Common code for OAuth-based services", summary: "Common code for OAuth-based services",
version: "1.2.1" version: "1.2.2"
}); });
Package.onUse(function (api) { Package.onUse(function (api) {