nodebb-plugin-freelog
Advanced tools
Comparing version 0.0.25 to 0.0.26
12
index.js
@@ -36,3 +36,10 @@ const plugin = {}; | ||
plugin.overrideLogin = function() { | ||
plugin.authValidate = async function(param) { | ||
console.log('authValidate', param); | ||
}; | ||
plugin.overrideLogin = function(req, username, password, next) { | ||
if (username === 'admin') { | ||
return next(); | ||
} | ||
passport.use(new passportLocal({ | ||
@@ -44,5 +51,2 @@ passReqToCallback: true | ||
plugin.login = function(req, username, password, next) { | ||
if (username === 'admin') { | ||
return next(null, null); | ||
} | ||
if (!username) { | ||
@@ -49,0 +53,0 @@ return next(new Error('[[error:invalid-username]]')); |
@@ -5,3 +5,3 @@ { | ||
"description": "NodeBB Forum", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"homepage": "http://www.nodebb.org", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -19,4 +19,8 @@ { | ||
"method": "overrideLogin" | ||
}, | ||
{ | ||
"hook": "static:auth.validate", | ||
"method": "authValidate" | ||
} | ||
] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5447
126