mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-04 21:59:51 +01:00
Merge branch 'master' of github.com:designcreateplay/NodeBB
This commit is contained in:
@@ -223,7 +223,7 @@ var RDB = require('./redis'),
|
||||
}
|
||||
}
|
||||
|
||||
plugins.fireHook('filter:posts.custom_profile_info', {profile: "", uid: post.uid}, function(err, profile_info) {
|
||||
plugins.fireHook('filter:posts.custom_profile_info', {profile: "", uid: post.uid, pid: post.pid}, function(err, profile_info) {
|
||||
post.additional_profile_info = profile_info.profile;
|
||||
|
||||
if (post.editor !== '') {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
passport.use(new passportTwitter({
|
||||
consumerKey: meta.config['social:twitter:key'],
|
||||
consumerSecret: meta.config['social:twitter:secret'],
|
||||
callbackURL: 'auth/twitter/callback'
|
||||
callbackURL: nconf.get('url') + 'auth/twitter/callback'
|
||||
}, function(token, tokenSecret, profile, done) {
|
||||
login_module.loginViaTwitter(profile.id, profile.username, profile.photos, function(err, user) {
|
||||
if (err) {
|
||||
@@ -56,7 +56,7 @@
|
||||
passport.use(new passportGoogle({
|
||||
clientID: meta.config['social:google:id'],
|
||||
clientSecret: meta.config['social:google:secret'],
|
||||
callbackURL: 'auth/google/callback'
|
||||
callbackURL: nconf.get('url') + 'auth/google/callback'
|
||||
}, function(accessToken, refreshToken, profile, done) {
|
||||
login_module.loginViaGoogle(profile.id, profile.displayName, profile.emails[0].value, function(err, user) {
|
||||
if (err) {
|
||||
|
||||
@@ -745,7 +745,7 @@ var path = require('path'),
|
||||
|
||||
var custom_routes = {
|
||||
'routes': [],
|
||||
'api_methods': []
|
||||
'api': []
|
||||
};
|
||||
|
||||
plugins.ready(function() {
|
||||
@@ -767,6 +767,20 @@ var path = require('path'),
|
||||
}(route));
|
||||
}
|
||||
}
|
||||
|
||||
var apiRoutes = custom_routes.api;
|
||||
for (var route in apiRoutes) {
|
||||
if (apiRoutes.hasOwnProperty(route)) {
|
||||
(function(route) {
|
||||
app[apiRoutes[route].method || 'get']('/api' + apiRoutes[route].route, function(req, res) {
|
||||
apiRoutes[route].callback(req, res, function(data) {
|
||||
res.json(data);
|
||||
});
|
||||
});
|
||||
}(route));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user