summaryrefslogtreecommitdiff
path: root/views/login.ejs
diff options
context:
space:
mode:
authorJulien Dessaux2022-10-27 23:56:29 +0200
committerJulien Dessaux2022-10-27 23:56:29 +0200
commit2611ded920a8345922346ed0d43e4efdd94401a1 (patch)
tree3313d976fbb11bdbfd1841ce336cc4372f9ab32c /views/login.ejs
parentAllow for placing the first word (diff)
downloadjeux-de-mots-2611ded920a8345922346ed0d43e4efdd94401a1.tar.gz
jeux-de-mots-2611ded920a8345922346ed0d43e4efdd94401a1.tar.bz2
jeux-de-mots-2611ded920a8345922346ed0d43e4efdd94401a1.zip
Began implementing middlewares, session and auth
Diffstat (limited to 'views/login.ejs')
-rw-r--r--views/login.ejs23
1 files changed, 23 insertions, 0 deletions
diff --git a/views/login.ejs b/views/login.ejs
new file mode 100644
index 0000000..e1178d7
--- /dev/null
+++ b/views/login.ejs
@@ -0,0 +1,23 @@
+<%- include("header") %>
+<form action="/login" method="post">
+ <% if (Object.keys(errors).length === 0) { %>
+ <h2>Connexion:</h2>
+ <% } else { %>
+ <h2>Oops, erreur de connexion!</h2>
+ <% } %>
+ <div class="form-field<%= errors.username ? ' form-field-invalid' : '' %>">
+ <input type="text" placeholder="Identifiant" name="username" value="<%= data.username %>" required autofocus>
+ <% if (errors.username) { %>
+ <label class="error" for="username"><%= errors.username.msg %></label>
+ <% } %>
+ </div>
+ <div class="form-field<%= errors.password ? ' form-field-invalid' : '' %>">
+ <input type="password" placeholder="Mot de passe" name="password" value="<%= data.password %>" required>
+ <% if (errors.password) { %>
+ <label class="error" for="password"><%= errors.password.msg %></label>
+ <% } %>
+ </div>
+ <button type="submit">Connexion</button>
+</form>
+<!-- TODO forgot password link -->
+<%- include("footer") %>