mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
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:
@@ -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.
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user