Auth registration, trial form hack

This commit is contained in:
femsci 2023-10-01 10:16:37 +02:00
parent 5e4bfaa95e
commit 6292bb23a8
Signed by: femsci
GPG key ID: 08F7911F0E650C67
4 changed files with 31 additions and 8 deletions

View file

@ -2,7 +2,7 @@
<PageTitle>About</PageTitle> <PageTitle>About</PageTitle>
<h1>Abut this app</h1> <h1>About this app</h1>
We made this app to provide a reliable platform for social working environments. 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. To create a renowned network where great minds can communicate their great ideas.

View file

@ -56,11 +56,11 @@
private async Task Submit() 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) if (resp.StatusCode == HttpStatusCode.OK)
{ {
Model = new(); Model = new();
ValidationMsg = "Successful login <3"; var user = await resp.Content.ReadFromJsonAsync<UserModel>(); ValidationMsg = "Successful register <3"; var user = await resp.Content.ReadFromJsonAsync<UserModel>();
if (user == null) if (user == null)
{ {
ValidationMsg = "Unknown authentication error"; ValidationMsg = "Unknown authentication error";
@ -73,16 +73,16 @@
return; return;
} }
if (resp.StatusCode == HttpStatusCode.Unauthorized) if (resp.StatusCode == HttpStatusCode.Conflict)
{ {
Model = new(); Model = new();
ValidationMsg = "Invalid username or password."; ValidationMsg = "User already registered.";
this.StateHasChanged(); this.StateHasChanged();
return; return;
} }
Model = new(); Model = new();
ValidationMsg = "Authorization error..."; ValidationMsg = "Registration error...";
this.StateHasChanged(); this.StateHasChanged();
} }
} }

View file

@ -12,7 +12,10 @@
<link href="css/app.css" rel="stylesheet" /> <link href="css/app.css" rel="stylesheet" />
<link rel="icon" type="image/png" href="favicon.png" /> <link rel="icon" type="image/png" href="favicon.png" />
<link href="Interlinked.Core.styles.css" rel="stylesheet" /> <link href="Interlinked.Core.styles.css" rel="stylesheet" />
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script> <script
src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js"
type="text/javascript"
></script>
</head> </head>
<body> <body>
@ -26,5 +29,6 @@
<a class="dismiss">🗙</a> <a class="dismiss">🗙</a>
</div> </div>
<script src="_framework/blazor.webassembly.js"></script> <script src="_framework/blazor.webassembly.js"></script>
<script src="js/femboy.js"></script>
</body> </body>
</html> </html>

View file

@ -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('<img src="data:image/svg+xml')) {
being.remove();
}
}
}
}
};
const observer = new MutationObserver(mutcal);
observer.observe(document.body, {
attributes: false,
childList: true,
subtree: false,
});