frontend et backend: Connexion d'un utilisateur

This commit is contained in:
Divlo
2020-04-06 16:46:03 +02:00
parent 8c37dbaaf4
commit 76298b6087
11 changed files with 184 additions and 31 deletions

View File

@ -1,6 +1,10 @@
function redirect (ctx, path) {
ctx.res.writeHead(302, { Location: path });
ctx.res.end();
function redirect(ctx, path) {
if (ctx.res) {
ctx.res.writeHead(302, { Location: path });
ctx.res.end();
} else {
document.location.pathname = path;
}
}
module.exports = redirect;