From 6292bb23a8bf070b1618377a026b80b87bb32503 Mon Sep 17 00:00:00 2001 From: femsci Date: Sun, 1 Oct 2023 10:16:37 +0200 Subject: [PATCH] Auth registration, trial form hack --- src/Interlinked.Core/Pages/About.razor | 4 ++-- src/Interlinked.Core/Pages/Register.razor | 10 +++++----- src/Interlinked.Core/wwwroot/index.html | 6 +++++- src/Interlinked.Core/wwwroot/js/femboy.js | 19 +++++++++++++++++++ 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 src/Interlinked.Core/wwwroot/js/femboy.js diff --git a/src/Interlinked.Core/Pages/About.razor b/src/Interlinked.Core/Pages/About.razor index e5bc462..fa9ca84 100644 --- a/src/Interlinked.Core/Pages/About.razor +++ b/src/Interlinked.Core/Pages/About.razor @@ -2,9 +2,9 @@ About -

Abut this app

+

About this app

We made this app to provide a reliable platform for social working environments. To create a renowned network where great minds can communicate their great ideas. -Innovation, teamwork, diversity, sommunity engagement, social connection are +Innovation, teamwork, diversity, sommunity engagement, social connection are all words that describe perfectly our desire to create that app. diff --git a/src/Interlinked.Core/Pages/Register.razor b/src/Interlinked.Core/Pages/Register.razor index ec22bd4..f23f15f 100644 --- a/src/Interlinked.Core/Pages/Register.razor +++ b/src/Interlinked.Core/Pages/Register.razor @@ -56,11 +56,11 @@ private async Task Submit() { - var resp = await req.PostAsJsonAsync("/api/auth/login", Model); + var resp = await req.PostAsJsonAsync("/api/auth/register", Model); if (resp.StatusCode == HttpStatusCode.OK) { Model = new(); - ValidationMsg = "Successful login <3"; var user = await resp.Content.ReadFromJsonAsync(); + ValidationMsg = "Successful register <3"; var user = await resp.Content.ReadFromJsonAsync(); if (user == null) { ValidationMsg = "Unknown authentication error"; @@ -73,16 +73,16 @@ return; } - if (resp.StatusCode == HttpStatusCode.Unauthorized) + if (resp.StatusCode == HttpStatusCode.Conflict) { Model = new(); - ValidationMsg = "Invalid username or password."; + ValidationMsg = "User already registered."; this.StateHasChanged(); return; } Model = new(); - ValidationMsg = "Authorization error..."; + ValidationMsg = "Registration error..."; this.StateHasChanged(); } } diff --git a/src/Interlinked.Core/wwwroot/index.html b/src/Interlinked.Core/wwwroot/index.html index 82ab2de..4c98acd 100644 --- a/src/Interlinked.Core/wwwroot/index.html +++ b/src/Interlinked.Core/wwwroot/index.html @@ -12,7 +12,10 @@ - + @@ -26,5 +29,6 @@ 🗙 + diff --git a/src/Interlinked.Core/wwwroot/js/femboy.js b/src/Interlinked.Core/wwwroot/js/femboy.js new file mode 100644 index 0000000..96bd7cd --- /dev/null +++ b/src/Interlinked.Core/wwwroot/js/femboy.js @@ -0,0 +1,19 @@ +const mutcal = (mutationList, observer) => { + for (const mutation of mutationList) { + if (mutation.type === "childList") { + const being = document.querySelector("body > div:last-child"); + if (being !== null) { + if (being.innerHTML.startsWith('