var Schedule = require("../models/schedule");
router.post("/", async function(req, res, next) {
let user;
if (req.body.username != null) {
user = await Schedule.findOne({
owner: {
name: req.body.username,
password: req.body.password
}
});
if (user === null) {
res.redirect('/register');
}
res.redirect(`/user/${req.body.username}`);
}
});