frontend et backend: Connexion d'un utilisateur

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

No files matched your search

+7 -3
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;