Skip to content

Commit

Permalink
check if admin is in database
Browse files Browse the repository at this point in the history
  • Loading branch information
adelifar committed Mar 6, 2019
1 parent 5769135 commit f98d5c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/authenticate/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ router.post('', (req, res) => {
let password="fullstack";
mongoose.connect(config.dbAddress, err => {
if (err) throw err;
user.countDocuments({}, (err, cnt) => {
user.countDocuments({isAdmin:true}, (err, cnt) => {
if (err) throw err;
if (cnt <= 0) { //add admin record
const admin = user({
Expand Down

0 comments on commit f98d5c6

Please sign in to comment.