-
Notifications
You must be signed in to change notification settings - Fork 2
/
ohauth-strategies.js
38 lines (38 loc) · 1.33 KB
/
ohauth-strategies.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var Strategies = {
twitter: function(consumerKey,consumerSecret,urls){
var config = {
requestURL: 'https://api.twitter.com/oauth/request_token',
accessURL: 'https://api.twitter.com/oauth/access_token',
authorizeURL: 'https://api.twitter.com/oauth/authorize',
consumerKey: consumerKey,
consumerSecret: consumerSecret
};
if(typeof urls ==='object'){
config.loginURL = urls.loginURL;
config.callbackURL = urls.callBackURL;
config.successURL = urls.successURL;
config.errorURL = urls.errorURL;
}else config.rootURL = urls; //it's just the necessary one
// return it for use in the constructor
return config;
},
socialflow: function(consumerKey,consumerSecret){
var config = {
requestURL: 'https://www.socialflow.com/oauth/request_token',
accessURL: 'https://www.socialflow.com/oauth/access_token',
authorizeURL: 'https://www.socialflow.com/oauth/authorize',
consumerKey: consumerKey,
consumerSecret: consumerSecret
};
if(typeof urls ==='object'){
config.loginURL = urls.loginURL;
config.callBackURL = urls.callBackURL;
config.successURL = urls.successURL;
config.errorURL = urls.errorURL;
}else config.callBackURL = urls; //it's just the necessary one
// return it for use in the constructor
return config;
}
};
// doesn't really exist as anything
module.exports = Strategies;