fix: restore organizationId mapping in auth login and middleware
This commit is contained in:
30
check-pass.cjs
Normal file
30
check-pass.cjs
Normal file
@@ -0,0 +1,30 @@
|
||||
const mongoose = require('mongoose');
|
||||
const bcrypt = require('bcryptjs');
|
||||
|
||||
const MONGODB_URI = 'mongodb+srv://admtracksteel:29OHAHpKTI8XcCNt@cluster0.a4xiilu.mongodb.net/ts_gpi?retryWrites=true&w=majority&appName=Cluster0';
|
||||
|
||||
const UserSchema = new mongoose.Schema({
|
||||
email: String,
|
||||
passwordHash: String
|
||||
});
|
||||
|
||||
async function check() {
|
||||
try {
|
||||
await mongoose.connect(MONGODB_URI);
|
||||
const User = mongoose.models.User || mongoose.model('User', UserSchema);
|
||||
const user = await User.findOne({ email: 'admtracksteel@gmail.com' });
|
||||
|
||||
if (user) {
|
||||
const isMatch = await bcrypt.compare('admin', user.passwordHash);
|
||||
console.log('PASSWORD_MATCH_ADMIN:' + isMatch);
|
||||
} else {
|
||||
console.log('USER_NOT_FOUND');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
await mongoose.disconnect();
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
check();
|
||||
Reference in New Issue
Block a user