Socket
Socket
Sign inDemoInstall

nodebb-plugin-freelog

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodebb-plugin-freelog - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

29

index.js
const plugin = {};
const passport = module.parent.require('passport');
const passportLocal = module.parent.require('passport-local').Strategy;
const axios = require('axios');
const userController = require.main.require('./src/controllers/user');
// 签到处理
plugin.topicReplyHandler = async function(data) {
let signTid = 0; // 签到帖ID
if (data.data.host === 'forum.freelog.com') {
signTid = 1;
} else if (data.data.host === 'forum.testfreelog.com') {
signTid = 2;
} else {
return;
}
if (data.data.tid !== signTid) {
return;
}
console.log('freelog-topicReplyHandler', JSON.stringify(data));
};
plugin.auth = async function() {
};
plugin.loadHandler = async function(params) {

@@ -12,2 +32,11 @@ console.log('freelog-loadHandler', JSON.stringify(params));

plugin.overrideLogin = async function(req, username, password, next) {
if (!username) {
return next(new Error('[[error:invalid-username]]'));
}
console.log(username, password);
console.log('登录成功');
userController.getUserDataByField(1, 'username', username, next);
};
module.exports = plugin;

7

package.json

@@ -5,3 +5,3 @@ {

"description": "NodeBB Forum",
"version": "0.0.3",
"version": "0.0.4",
"homepage": "http://www.nodebb.org",

@@ -12,3 +12,6 @@ "repository": {

},
"main": "index.js"
"main": "index.js",
"dependencies": {
"axios": "^0.27.2"
}
}

@@ -15,4 +15,8 @@ {

"method": "topicReplyHandler"
},
{
"hook": "action:auth.overrideLogin",
"method": "overrideLogin"
}
]
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc