From 70931975f567492c9ba2e565e3e4f37a7c386de4 Mon Sep 17 00:00:00 2001 From: Moritz Bergmann Date: Fri, 15 Mar 2024 10:57:55 +0100 Subject: [PATCH] added a display name to the project --- public/auth/sign_up.html | 8 +++++++- public/auth/sign_up.js | 3 ++- public/feed.html | 10 ++++++---- public/feed.js | 5 +++-- public/scripts/api/account.js | 17 ++++++++++------- public/scripts/api/auth.js | 2 +- public/scripts/api/users.js | 7 ++++--- src/account.rs | 13 +++++++++++++ src/database.rs | 9 ++++++--- src/logic/auth.rs | 4 ++-- 10 files changed, 54 insertions(+), 24 deletions(-) diff --git a/public/auth/sign_up.html b/public/auth/sign_up.html index f38cf95..2743dd3 100644 --- a/public/auth/sign_up.html +++ b/public/auth/sign_up.html @@ -26,6 +26,12 @@

Sign Up

+ + +
+ + +
@@ -60,4 +66,4 @@

Sign Up

- \ No newline at end of file + diff --git a/public/auth/sign_up.js b/public/auth/sign_up.js index 9e0cf51..d1928e8 100644 --- a/public/auth/sign_up.js +++ b/public/auth/sign_up.js @@ -4,6 +4,7 @@ document.querySelector("#form").addEventListener("submit", async (e) => { e.preventDefault(); const username = document.querySelector("#username").value; + const display_name = document.querySelector("#display-name").value; const password1 = document.querySelector("#password1").value; const password2 = document.querySelector("#password2").value; @@ -12,7 +13,7 @@ document.querySelector("#form").addEventListener("submit", async (e) => { return; } - const account = new NewAccount(username, password1); + const account = new NewAccount(username, display_name, password1); const res = await create(account); if (res.ok) { window.location = "/index.html"; diff --git a/public/feed.html b/public/feed.html index ffff684..c35e03d 100644 --- a/public/feed.html +++ b/public/feed.html @@ -40,13 +40,15 @@

Weekly PushUps Challenge