remove oauth 1 and 2 client file altogether

This commit is contained in:
Mike Bannister
2012-08-02 01:12:20 -04:00
committed by Nick Martin
parent ca40bf2875
commit 6141c032ee
9 changed files with 8 additions and 30 deletions

View File

@@ -17,7 +17,7 @@
'&redirect_uri=' + Meteor.accounts.facebook._appUrl + '/_oauth/facebook?close' +
'&display=' + display + '&scope=' + scope + '&state=' + state;
Meteor.accounts.oauth2.initiateLogin(state, loginUrl);
Meteor.accounts.oauth.initiateLogin(state, loginUrl, { oauthVersion: 2 });
};
})();

View File

@@ -25,7 +25,7 @@
'&redirect_uri=' + Meteor.accounts.google._appUrl + '/_oauth/google?close' +
'&state=' + state;
Meteor.accounts.oauth2.initiateLogin(state, loginUrl);
Meteor.accounts.oauth.initiateLogin(state, loginUrl, { oauthVersion: 2 });
};
}) ();

View File

@@ -3,7 +3,7 @@
//
// @param state {String} The OAuth state generated by the client
// @param url {String} url to page
Meteor.accounts.oauth.initiateLogin = function(state, url, oauthVersion) {
Meteor.accounts.oauth.initiateLogin = function(state, url, options) {
// XXX these dimensions worked well for facebook and google, but
// it's sort of weird to have these here. Maybe an optional
// argument instead?
@@ -12,7 +12,7 @@
var checkPopupOpen = setInterval(function() {
if (popup.closed) {
clearInterval(checkPopupOpen);
tryLoginAfterPopupClosed(state, oauthVersion);
tryLoginAfterPopupClosed(state, options);
}
}, 100);
};
@@ -20,9 +20,9 @@
// Send an OAuth login method to the server. If the user authorized
// access in the popup this should log the user in, otherwise
// nothing should happen.
var tryLoginAfterPopupClosed = function(state, oauthVersion) {
var tryLoginAfterPopupClosed = function(state, options) {
Meteor.apply('login', [
{oauth: {oauthVersion: oauthVersion, state: state}}
{oauth: {version: options.oauthVersion, state: state}}
], {wait: true}, function(error, result) {
if (error)
throw error;

View File

@@ -1,10 +0,0 @@
(function () {
// Open a popup window pointing to a OAuth1 handshake page
//
// @param state {String} The OAuth1 state generated by the client
// @param url {String} url to page
Meteor.accounts.oauth1.initiateLogin = function(state, url) {
// Include the oauth version as the last parameter
Meteor.accounts.oauth.initiateLogin(state, url, 1);
};
})();

View File

@@ -9,7 +9,6 @@ Package.on_use(function (api) {
api.add_files('oauth1_common.js', ['client', 'server']);
api.add_files('oauth1_server.js', 'server');
api.add_files('oauth1_client.js', 'client');
});
Package.on_test(function (api) {

View File

@@ -1,10 +0,0 @@
(function () {
// Open a popup window pointing to a OAuth handshake page
//
// @param state {String} The OAuth state generated by the client
// @param url {String} url to page
Meteor.accounts.oauth2.initiateLogin = function(state, url) {
// Include the oauth version as the last parameter
Meteor.accounts.oauth.initiateLogin(state, url, 2);
};
})();

View File

@@ -9,7 +9,6 @@ Package.on_use(function (api) {
api.add_files('oauth2_common.js', ['client', 'server']);
api.add_files('oauth2_server.js', 'server');
api.add_files('oauth2_client.js', 'client');
});
Package.on_test(function (api) {

View File

@@ -7,7 +7,7 @@
var callbackUrl = Meteor.accounts.twitter._appUrl + '/_oauth/twitter?close&state=' + state;
var url = '/_oauth/twitter/request_token?callbackUrl=' + encodeURIComponent(callbackUrl)
Meteor.accounts.oauth1.initiateLogin(state, url);
Meteor.accounts.oauth.initiateLogin(state, url, { oauthVersion: 1 });
};
})();

View File

@@ -12,7 +12,7 @@
'&redirect_uri=' + Meteor.accounts.weibo._appUrl + '/_oauth/weibo?close' +
'&state=' + state;
Meteor.accounts.oauth2.initiateLogin(state, loginUrl);
Meteor.accounts.oauth.initiateLogin(state, loginUrl, { oauthVersion: 2 });
};
}) ();