Auth registration, trial form hack
This commit is contained in:
parent
5e4bfaa95e
commit
6292bb23a8
4 changed files with 31 additions and 8 deletions
|
@ -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.
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
19
src/Interlinked.Core/wwwroot/js/femboy.js
Normal file
19
src/Interlinked.Core/wwwroot/js/femboy.js
Normal 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,
|
||||||
|
});
|
Loading…
Reference in a new issue