Skip to content

Commit f34614e

Browse files
committed
test
Co-authored-by: Jon Cruz [email protected] Co-authored-by: Elena Atencio [email protected] Co-authored-by: John Donato [email protected]
1 parent 49bce6e commit f34614e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

electron/databases/mongoDB.js

Whitespace-only changes.

electron/routes/dashboard.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const User = require('../models/UserModel')
88
const mongoose = require('mongoose');
99
// const db = require('../databases/mongo')
1010

11-
const MONGO_URI = 'mongodb+srv://wiris316:[email protected]/?retryWrites=true&w=majority'
11+
const MONGO_URI = ''
1212
mongoose.connect(MONGO_URI, {
1313
useNewUrlParser: true,
1414
useUnifiedtopology: true,
@@ -35,10 +35,10 @@ const settingsLocation = path.resolve(__dirname, '../../settings.json');
3535
// this.mode = 'light';
3636
// }
3737

38-
// hashPassword(password: string) {
39-
// const salt = bcrypt.genSaltSync(saltRounds);
40-
// return bcrypt.hashSync(password, salt);
41-
// }
38+
function hashPassword(password: string) {
39+
const salt = bcrypt.genSaltSync(saltRounds);
40+
return bcrypt.hashSync(password, salt);
41+
}
4242
// }
4343
function checkUser(username) {
4444
const userExist = User.findOne({ username })
@@ -50,7 +50,7 @@ function checkUser(username) {
5050

5151
function addUser(username, password, email) {
5252
console.log('inside addUser', username)
53-
const newUser = new User({ username: username, password: password, email: email})
53+
const newUser = new User({ username: username, password: hashPassword(password), email: email})
5454
console.log('after calling new User')
5555

5656
newUser.save()

0 commit comments

Comments
 (0)