From d7ed1196bdd44d7734d41d91a5e72a71785e0a08 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 5 Jan 2023 02:09:07 +0100 Subject: switched to single quotes string in eslint --- controllers/root/login.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'controllers/root/login.js') diff --git a/controllers/root/login.js b/controllers/root/login.js index ac6a471..431f7f9 100644 --- a/controllers/root/login.js +++ b/controllers/root/login.js @@ -1,14 +1,14 @@ -import { validationResult } from "express-validator"; +import { validationResult } from 'express-validator'; -import { login } from "../../database/users.js"; +import { login } from '../../database/users.js'; function makePageData(user) { return { - title: "Connexion", + title: 'Connexion', user: user, data: { - username: "", - password: "", + username: '', + password: '', }, errors: {}, }; @@ -16,14 +16,14 @@ function makePageData(user) { export function login_get(req, res) { if (req.session.user !== undefined) { - return res.redirect(302, "/games"); + return res.redirect(302, '/games'); } - return res.render("login", makePageData(req.session.user)); + return res.render('login', makePageData(req.session.user)); } export async function login_post(req, res) { if (req.session.user !== undefined) { - return res.redirect(302, "/games"); + return res.redirect(302, '/games'); } let page = makePageData(req.session.user); page.data = req.body; @@ -33,11 +33,11 @@ export async function login_post(req, res) { if (user !== null) { req.session.user = user; } else { - page.errors.mismatch = "L'identifiant et le mot de passe ne correspondent pas, ou l'identifiant n'existe pas."; + page.errors.mismatch = 'L\'identifiant et le mot de passe ne correspondent pas, ou l\'identifiant n\'existe pas.'; } } if (Object.keys(page.errors).length === 0) { - return res.redirect(302, "/games"); + return res.redirect(302, '/games'); } - return res.render("login", page); + return res.render('login', page); } -- cgit v1.2.3