This commit is contained in:
clement callaert 2023-11-04 01:32:44 +01:00
parent adccacf09c
commit b341199c69
11 changed files with 20 additions and 15 deletions

View file

@ -9,13 +9,18 @@ async function auth (req, res, next) {
if (!user || !isAuth) {
return next();
}
const userDoc = await db.getDb().collection('users').findOne({_id: user.id})
const isAdmin = userDoc.isAdmin;
res.locals.user = userDoc;
res.locals.isAuth = isAuth;
res.locals.isAdmin = isAdmin;
if (userDoc && userDoc.isAdmin) {
const isAdmin = userDoc.isAdmin;
res.locals.user = userDoc;
res.locals.isAuth = isAuth;
res.locals.isAdmin = isAdmin;
}
next();
}

View file

@ -5,7 +5,7 @@
<%- include('includes/header.ejs') %>
<main>
<video id="background-video" autoplay loop muted>
<source src="https://www.vecteezy.com/video/11128600-space-galaxy-and-nebula" type="video/mp4">
<source src="https://files.vecteezy.com/system/protected/files/006/671/832/vecteezy_traveling-through-star-fields-in-space-to-a-distant-galaxy_6671832_942.mp4" type="video/mp4">
</video>
<div id="first_div">
<h1>

View file

@ -5,7 +5,7 @@
<%- include('includes/header.ejs') %>
<main>
<video id="background-video" autoplay loop muted>
<source src="video/videoBackground.mp4" type="video/mp4">
<source src="https://files.vecteezy.com/system/protected/files/006/671/832/vecteezy_traveling-through-star-fields-in-space-to-a-distant-galaxy_6671832_942.mp4" type="video/mp4">
</video>
<div id="first_div">
<h1>

View file

@ -5,7 +5,7 @@
<%- include('includes/header.ejs') %>
<main>
<video id="background-video" autoplay loop muted>
<source src="video/videoBackground.mp4" type="video/mp4">
<source src="https://files.vecteezy.com/system/protected/files/006/671/832/vecteezy_traveling-through-star-fields-in-space-to-a-distant-galaxy_6671832_942.mp4" type="video/mp4">
</video>
<div id="first_div">
<h1>

View file

@ -5,7 +5,7 @@
<%- include('includes/header.ejs') %>
<main>
<video id="background-video" autoplay loop muted>
<source src="video/videoBackground.mp4" type="video/mp4">
<source src="https://files.vecteezy.com/system/protected/files/006/671/832/vecteezy_traveling-through-star-fields-in-space-to-a-distant-galaxy_6671832_942.mp4" type="video/mp4">
</video>
<div id="first_div">
<h1>

View file

@ -5,7 +5,7 @@
<%- include('includes/header') %>
<main>
<video id="background-video" autoplay loop muted>
<source src="https://www.vecteezy.com/video/11128600-space-galaxy-and-nebula" type="video/mp4">
<source src="https://files.vecteezy.com/system/protected/files/006/671/832/vecteezy_traveling-through-star-fields-in-space-to-a-distant-galaxy_6671832_942.mp4" type="video/mp4">
</video>
<div id="first_div">
<h1>

View file

@ -5,7 +5,7 @@
<%- include('includes/header') %>
<main id="signup">
<video id="background-video" autoplay loop muted>
<source src="video/videoBackground.mp4" type="video/mp4">
<source src="https://files.vecteezy.com/system/protected/files/006/671/832/vecteezy_traveling-through-star-fields-in-space-to-a-distant-galaxy_6671832_942.mp4" type="video/mp4">
</video>
<div id="first_div">
<h1>

View file

@ -5,7 +5,7 @@
<%- include('includes/header.ejs') %>
<main>
<video id="background-video" autoplay loop muted>
<source src="video/videoBackground.mp4" type="video/mp4">
<source src="https://files.vecteezy.com/system/protected/files/006/671/832/vecteezy_traveling-through-star-fields-in-space-to-a-distant-galaxy_6671832_942.mp4" type="video/mp4">
</video>
<div id="first_div">
<h1>

View file

@ -6,7 +6,7 @@
<%- include('includes/header') %>
<main>
<video id="background-video" autoplay loop muted>
<source src="video/videoBackground.mp4" type="video/mp4">
<source src="https://files.vecteezy.com/system/protected/files/006/671/832/vecteezy_traveling-through-star-fields-in-space-to-a-distant-galaxy_6671832_942.mp4" type="video/mp4">
</video>
<div id="hiddenDiv">
<h1>

View file

@ -5,7 +5,7 @@
<%- include('includes/header.ejs') %>
<main>
<video id="background-video" autoplay loop muted>
<source src="video/videoMilkyWay.mp4" type="video/mp4">
<source src="https://files.vecteezy.com/system/protected/files/021/571/018/vecteezy_milky-way-galaxy-zoom-out-space-flight_21571018_29.mp4" type="video/mp4">
</video>
<div class="divLogoPerm">

View file

@ -5,7 +5,7 @@
<%- include('includes/header') %>
<main>
<video id="background-video" autoplay loop muted>
<source src="video/videoBackground.mp4" type="video/mp4">
<source src="https://files.vecteezy.com/system/protected/files/006/671/832/vecteezy_traveling-through-star-fields-in-space-to-a-distant-galaxy_6671832_942.mp4" type="video/mp4">
</video>
<div id="first_div">