Fix semicolons
This commit is contained in:
parent
d361e7c516
commit
fdfbcceb01
16 changed files with 23 additions and 23 deletions
4
app.js
4
app.js
|
@ -12,8 +12,8 @@ const edtRouter = require("./routes/edt");
|
|||
const homeRouter = require("./routes/home");
|
||||
const marksRouter = require("./routes/marks");
|
||||
const registerRouter = require("./routes/register");
|
||||
const viescolRouter = require("./routes/viescol")
|
||||
const profilRouter = require("./routes/profil")
|
||||
const viescolRouter = require("./routes/viescol");
|
||||
const profilRouter = require("./routes/profil");
|
||||
|
||||
let app = express();
|
||||
const sessionMiddleware = session({
|
||||
|
|
|
@ -19,7 +19,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||
class User extends Model {
|
||||
static associate(models) {
|
||||
User.belongsToMany(models.Group, {through: "UserGroup"});
|
||||
User.belongsToMany(models.Event, {through: "EventTeacher"})
|
||||
User.belongsToMany(models.Event, {through: "EventTeacher"});
|
||||
User.belongsToMany(models.UE, {through: "UEUser"});
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ document.getElementById("login").addEventListener("submit", e=>{
|
|||
alert('Format d\'email incorrect.');
|
||||
}
|
||||
return false;
|
||||
})
|
||||
});
|
||||
|
||||
socket.on("login", data=>{
|
||||
if(data.error){
|
||||
|
@ -19,4 +19,4 @@ socket.on("login", data=>{
|
|||
}else{
|
||||
window.location.href = "/";
|
||||
}
|
||||
})
|
||||
});
|
|
@ -18,7 +18,7 @@ socket.on("logout", data=>{
|
|||
}else{
|
||||
window.location.href = "/";
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
function profilRedirect(){
|
||||
|
|
|
@ -18,4 +18,4 @@ socket.on("profileEdit", data=>{
|
|||
}else{
|
||||
window.location.href = "/";
|
||||
}
|
||||
})
|
||||
});
|
|
@ -20,4 +20,4 @@ socket.on("register", data=>{
|
|||
}else{
|
||||
window.location.href = "/";
|
||||
}
|
||||
})
|
||||
});
|
||||
|
|
|
@ -11,4 +11,4 @@ module.exports = socket => {
|
|||
else
|
||||
await emailCheck(socket, user, null);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -10,4 +10,4 @@ module.exports = socket => {
|
|||
else
|
||||
await emailPassword(socket, user, null);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@ module.exports = socket => {
|
|||
return async (data) => {
|
||||
let user = await models.User.findOne({where: {passwordToken: data.token}});
|
||||
if (!user)
|
||||
socket.emit("setPassword", {error: {message: "invalid_token"}})
|
||||
socket.emit("setPassword", {error: {message: "invalid_token"}});
|
||||
else if (user.passwordTokenDate && ((new Date().getTime() - user.passwordTokenDate.getTime()) / 1000 > 3600))
|
||||
socket.emit("setPassword", {error: {message: "expired_token"}});
|
||||
else {
|
||||
|
@ -16,4 +16,4 @@ module.exports = socket => {
|
|||
socket.emit("setPassword", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -15,4 +15,4 @@ module.exports = socket => {
|
|||
socket.emit("login", user)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -7,4 +7,4 @@ module.exports = socket => {
|
|||
socket.emit("logout", {error: { message: "not_logged_in"}});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
|
@ -6,7 +6,7 @@ module.exports = socket => {
|
|||
if (!user)
|
||||
socket.emit("profileEdit", {error: {message: "not_found"}});
|
||||
else if (!user.checkPassword(data.oldPassword))
|
||||
socket.emit("profileEdit", {error: {message: "invalid_password"}})
|
||||
socket.emit("profileEdit", {error: {message: "invalid_password"}});
|
||||
else {
|
||||
if (data.firstName !== user.firstName)
|
||||
user.firstName = data.firstName;
|
||||
|
@ -14,10 +14,10 @@ module.exports = socket => {
|
|||
user.lastName = data.lastName;
|
||||
user.newPassword = data.newPassword;
|
||||
if (data.password && !user.checkPassword(data.password))
|
||||
user.passwordHash = data.password
|
||||
user.passwordHash = data.password;
|
||||
socket.request.session.user = user;
|
||||
socket.request.session.save();
|
||||
socket.emit("profileEdit", user)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -18,4 +18,4 @@ module.exports = socket => {
|
|||
await emailCheck(socket, user, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
|
@ -16,7 +16,7 @@ module.exports = async (socket, user, callBack) => {
|
|||
subject: "forgot password"
|
||||
}), async (err, message) => {
|
||||
if (err)
|
||||
socket.emit("forgotPassword", {error: {message: "fail_send_mail"}})
|
||||
socket.emit("forgotPassword", {error: {message: "fail_send_mail"}});
|
||||
else {
|
||||
user.passwordToken = token;
|
||||
user.passwordTokenDate = new Date();
|
||||
|
|
|
@ -20,7 +20,7 @@ async function clean() {
|
|||
|
||||
before(async () => {
|
||||
[app, models] = await setup();
|
||||
})
|
||||
});
|
||||
|
||||
it("Main page content", async () => {
|
||||
await request(app)
|
||||
|
|
|
@ -7,9 +7,9 @@ html
|
|||
link(rel="stylesheet", href="/stylesheets/style.css")
|
||||
script(src="/socket.io/socket.io.js")
|
||||
body
|
||||
- var student = false
|
||||
- var teacher = true
|
||||
- var admin = false
|
||||
- let student = false
|
||||
- let teacher = true
|
||||
- let admin = false
|
||||
div(class="row" id="page")
|
||||
div(class="col s2" id="panel")
|
||||
block navbar
|
||||
|
|
Reference in a new issue