fix: restore organizationId mapping in auth login and middleware
This commit is contained in:
25
check-user.cjs
Normal file
25
check-user.cjs
Normal file
@@ -0,0 +1,25 @@
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
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,
|
||||
role: String,
|
||||
passwordHash: String,
|
||||
externalId: 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' });
|
||||
console.log('USER_CHECK_RESULT:' + JSON.stringify(user));
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
await mongoose.disconnect();
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
check();
|
||||
Reference in New Issue
Block a user