mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
fix: #8974, with password login for approval queue
This commit is contained in:
@@ -66,7 +66,10 @@ module.exports = function (User) {
|
|||||||
}
|
}
|
||||||
const creation_time = await db.sortedSetScore('registration:queue', username);
|
const creation_time = await db.sortedSetScore('registration:queue', username);
|
||||||
const uid = await User.create(userData);
|
const uid = await User.create(userData);
|
||||||
await User.setUserField(uid, 'password', userData.hashedPassword);
|
await User.setUserFields(uid, {
|
||||||
|
password: userData.hashedPassword,
|
||||||
|
'password:shaWrapped': 1,
|
||||||
|
});
|
||||||
await removeFromQueue(username);
|
await removeFromQueue(username);
|
||||||
await markNotificationRead(username);
|
await markNotificationRead(username);
|
||||||
await plugins.hooks.fire('filter:register.complete', { uid: uid });
|
await plugins.hooks.fire('filter:register.complete', { uid: uid });
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ module.exports = function (User) {
|
|||||||
|
|
||||||
User.isPasswordCorrect = async function (uid, password, ip) {
|
User.isPasswordCorrect = async function (uid, password, ip) {
|
||||||
password = password || '';
|
password = password || '';
|
||||||
var { password: hashedPassword, 'password:shaWrapped': shaWrapped } = await db.getObjectFields('user:' + uid, ['password', 'password:shaWrapped']);
|
var {
|
||||||
|
password: hashedPassword,
|
||||||
|
'password:shaWrapped': shaWrapped,
|
||||||
|
} = await db.getObjectFields('user:' + uid, ['password', 'password:shaWrapped']);
|
||||||
if (!hashedPassword) {
|
if (!hashedPassword) {
|
||||||
// Non-existant user, submit fake hash for comparison
|
// Non-existant user, submit fake hash for comparison
|
||||||
hashedPassword = '';
|
hashedPassword = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user