29 Commits
Author SHA1 Message Date
Aeolin Ferjünnoz 870630063a - fixed two way binding
- added support for list like attributes to toggle classes for example
2026-04-14 15:00:11 +02:00
Aeolin Ferjünnoz 0f2874e6df - seems to be working
- added some utility
2026-04-13 21:19:07 +02:00
Aeolin Ferjünnoz 11ebf22ec9 - virtual dom based approach working 2026-04-13 20:53:26 +02:00
Aeolin Ferjünnoz 62ac0a6bb7 - pwa kinda working 2026-04-13 18:02:14 +02:00
Aeolin Ferjünnoz a2b898b54f experimental pwa implementation 2026-04-13 16:35:53 +02:00
Aeolin Ferjünnoz 4eaea29513 - added instructions on docker usage 2026-04-12 17:18:29 +02:00
Aeolin Ferjünnoz 806ad23315 - register and login working 2026-04-12 17:14:52 +02:00
Aeolin Ferjünnoz 6abc36bc9b - started implementing frontend to backend 2026-04-12 16:38:59 +02:00
Aeolin Ferjünnoz 3c9f7323ba - first version of backend done 2026-04-12 03:45:01 +02:00
Aeolin Ferjünnoz d466365348 - implement most controllers 2026-04-12 02:23:26 +02:00
Aeolin Ferjünnoz 22aabc8f27 - started implementing backend 2026-04-11 21:36:05 +02:00
nachbaisabel 3da8813c41 filter for marketplace 2026-04-07 23:56:55 +02:00
nachbaisabel 02b8a75947 prompt creation & detail page 2026-04-07 23:46:17 +02:00
nachbaisabel d2d5c0c66c new pages and linking 2026-04-06 20:58:30 +02:00
nachbaisabel 4105659b0b feed page 2026-04-06 20:18:25 +02:00
nachbaisabel da52852fdf removed files 2026-04-06 16:32:00 +02:00
nachbaisabel 7b23b296d3 marketplace 2026-04-06 16:30:55 +02:00
nachbaisabel a4a5d03f9f creators page 2026-04-06 16:21:33 +02:00
nachbaisabel 11e973ce61 login, signup, profile page setup 2026-04-05 18:04:51 +02:00
yogarathuvar c5a1692d6b Merge pull request 'Add initial HTML layout' (#1) from chore-html-layout into main
Reviewed-on: #1
2026-02-26 20:37:12 +01:00
Thuvaraka Yogarajah 566e6d41e3 Add initial HTML layout 2026-02-26 20:35:54 +01:00
nachbaisabel 373f217fe6 readme 2026-02-25 18:04:01 +01:00
klessafloria 57edcbedb7 README.md aktualisiert 2026-02-25 14:27:27 +01:00
nachbaisabel 93ae7cef36 readme update 2026-02-23 18:38:29 +01:00
nachbaisabel a20b2fe507 first readme 2026-02-23 18:32:19 +01:00
nachbaisabel b0aa18a3e0 readme 2026-02-22 19:09:37 +01:00
nachbaisabel 88740ecbc3 projektanforderungen moodle 2026-02-22 16:52:40 +01:00
nachbaisabel e14a0fd8d3 readme template 2026-02-22 16:46:47 +01:00
nachbaisabel 5383429a53 README.md hinzugefügt 2026-02-09 14:36:40 +01:00
13 changed files with 23 additions and 66 deletions

No files matched your search

@@ -16,7 +16,7 @@ namespace OnlyPrompt.Backend.Controllers
[Route("api/v1/auth")] [Route("api/v1/auth")]
public class AuthController : BaseController public class AuthController : BaseController
{ {
private static readonly CookieOptions AuthCookieOptions = new CookieOptions { Secure = false, HttpOnly = true, IsEssential = true, SameSite = SameSiteMode.Lax }; private static readonly CookieOptions AuthCookieOptions = new CookieOptions { Secure = true, HttpOnly = true, IsEssential = true };
private readonly IPasswordHasher<UserModel> _passwordHasher; private readonly IPasswordHasher<UserModel> _passwordHasher;
private readonly ITokenService _jwtService; private readonly ITokenService _jwtService;
private readonly ILogger<AuthController> _logger; private readonly ILogger<AuthController> _logger;
@@ -103,18 +103,7 @@ namespace OnlyPrompt.Backend.Controllers
public RedirectHttpResult Logout() public RedirectHttpResult Logout()
{ {
this.Response.Cookies.Delete("jwt", AuthCookieOptions); this.Response.Cookies.Delete("jwt", AuthCookieOptions);
return TypedResults.Redirect("/login"); return TypedResults.Redirect("login");
}
[Authorize]
[HttpGet("me")]
public async Task<Results<Ok<ApiUser>, NotFound<string>>> GetCurrentUserAsync()
{
var user = await GetUserAsync();
if (user is null)
return TypedResults.NotFound("User not found");
return TypedResults.Ok(_mapper.Map<ApiUser>(user));
} }
} }
} }
-8
View File
@@ -80,7 +80,6 @@ var rewrite = new RewriteOptions()
.AddRewrite(@"^(?!scalar\/?|api\/?)([^.]+)$", "$1.html", skipRemainingRules: true); .AddRewrite(@"^(?!scalar\/?|api\/?)([^.]+)$", "$1.html", skipRemainingRules: true);
app.UseRewriter(rewrite); app.UseRewriter(rewrite);
app.UseAuthentication();
app.UseAuthorization(); app.UseAuthorization();
if (app.Environment.IsDevelopment()) if (app.Environment.IsDevelopment())
{ {
@@ -98,13 +97,6 @@ else
} }
app.MapControllers(); app.MapControllers();
app.MapGet("/", async (HttpContext context) =>
{
var authResult = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme);
return authResult.Succeeded
? Results.Redirect("/dashboard")
: Results.Redirect("/login");
});
app.MapFallbackToFile("/login.html"); app.MapFallbackToFile("/login.html");
using var scope = app.Services.CreateScope(); using var scope = app.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<OnlyPromptContext>(); var db = scope.ServiceProvider.GetRequiredService<OnlyPromptContext>();
+2 -2
View File
@@ -108,7 +108,7 @@
</div> </div>
<script> <script>
fetch('/sidebar.html') fetch('../html/sidebar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => { .then(data => {
document.getElementById('sidebar-container').innerHTML = data; document.getElementById('sidebar-container').innerHTML = data;
@@ -121,7 +121,7 @@
if (chatsLink) chatsLink.classList.add('active'); if (chatsLink) chatsLink.classList.add('active');
}); });
fetch('/topbar.html') fetch('../html/topbar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => document.getElementById('topbar-container').innerHTML = data); .then(data => document.getElementById('topbar-container').innerHTML = data);
</script> </script>
+2 -2
View File
@@ -140,7 +140,7 @@
</div> </div>
<script> <script>
fetch('/sidebar.html') fetch('../html/sidebar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => { .then(data => {
document.getElementById('sidebar-container').innerHTML = data; document.getElementById('sidebar-container').innerHTML = data;
@@ -153,7 +153,7 @@
if (thirdLink) thirdLink.classList.add('active'); if (thirdLink) thirdLink.classList.add('active');
}); });
fetch('/topbar.html') fetch('../html/topbar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => document.getElementById('topbar-container').innerHTML = data); .then(data => document.getElementById('topbar-container').innerHTML = data);
</script> </script>
+2 -2
View File
@@ -160,7 +160,7 @@
}); });
// Fetch sidebar and topbar // Fetch sidebar and topbar
fetch('/sidebar.html') fetch('../html/sidebar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => { .then(data => {
document.getElementById('sidebar-container').innerHTML = data; document.getElementById('sidebar-container').innerHTML = data;
@@ -173,7 +173,7 @@
if (createLink) createLink.classList.add('active'); if (createLink) createLink.classList.add('active');
}); });
fetch('/topbar.html') fetch('../html/topbar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => document.getElementById('topbar-container').innerHTML = data); .then(data => document.getElementById('topbar-container').innerHTML = data);
</script> </script>
+1 -10
View File
@@ -100,22 +100,13 @@
padding-top: 16px; padding-top: 16px;
} }
.sidebar-bottom form {
margin: 0;
}
.sidebar-logout { .sidebar-logout {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
width: 100%;
padding: 12px 16px; padding: 12px 16px;
border: 0;
background: transparent;
cursor: pointer;
text-decoration: none; text-decoration: none;
color: #64748b; color: #64748b;
font: inherit;
font-weight: 600; font-weight: 600;
transition: background 0.2s ease; transition: background 0.2s ease;
} }
@@ -176,4 +167,4 @@
.sidebar-logout { .sidebar-logout {
padding: 10px; padding: 10px;
} }
} }
+2 -2
View File
@@ -145,7 +145,7 @@
</div> </div>
<script> <script>
fetch('/sidebar.html') fetch('../html/sidebar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => { .then(data => {
document.getElementById('sidebar-container').innerHTML = data; document.getElementById('sidebar-container').innerHTML = data;
@@ -158,7 +158,7 @@
if (firstLink) firstLink.classList.add('active'); if (firstLink) firstLink.classList.add('active');
}); });
fetch('/topbar.html') fetch('../html/topbar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => document.getElementById('topbar-container').innerHTML = data); .then(data => document.getElementById('topbar-container').innerHTML = data);
</script> </script>
+1 -14
View File
@@ -1,16 +1,5 @@
import { sendFormAsync } from "./shared.js"; import { sendFormAsync } from "./shared.js";
async function redirectIfAlreadySignedIn() {
const response = await fetch('/api/v1/auth/me', {
method: 'GET',
credentials: 'same-origin'
});
if (response.ok) {
window.location.replace('/dashboard');
}
}
function togglePassword() { function togglePassword() {
const passwordInput = document.getElementById('password'); const passwordInput = document.getElementById('password');
const newInputType = passwordInput.type === 'password' ? 'text' : 'password'; const newInputType = passwordInput.type === 'password' ? 'text' : 'password';
@@ -29,6 +18,4 @@ const loginForm = document.getElementById('loginForm');
loginForm.addEventListener('submit', async (event) => { loginForm.addEventListener('submit', async (event) => {
event.preventDefault(); // Prevent the default form submission event.preventDefault(); // Prevent the default form submission
await submitLoginForm(); await submitLoginForm();
}); });
await redirectIfAlreadySignedIn();
+2 -2
View File
@@ -216,7 +216,7 @@
</div> </div>
<script> <script>
fetch('/sidebar.html') fetch('../html/sidebar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => { .then(data => {
document.getElementById('sidebar-container').innerHTML = data; document.getElementById('sidebar-container').innerHTML = data;
@@ -229,7 +229,7 @@
if (secondLink) secondLink.classList.add('active'); if (secondLink) secondLink.classList.add('active');
}); });
fetch('/topbar.html') fetch('../html/topbar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => document.getElementById('topbar-container').innerHTML = data); .then(data => document.getElementById('topbar-container').innerHTML = data);
</script> </script>
+2 -2
View File
@@ -93,7 +93,7 @@
<script> <script>
// Fetch sidebar and topbar // Fetch sidebar and topbar
fetch('/sidebar.html') fetch('../html/sidebar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => { .then(data => {
document.getElementById('sidebar-container').innerHTML = data; document.getElementById('sidebar-container').innerHTML = data;
@@ -106,7 +106,7 @@
if (marketplaceLink) marketplaceLink.classList.add('active'); if (marketplaceLink) marketplaceLink.classList.add('active');
}); });
fetch('/topbar.html') fetch('../html/topbar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => document.getElementById('topbar-container').innerHTML = data); .then(data => document.getElementById('topbar-container').innerHTML = data);
</script> </script>
+2 -2
View File
@@ -90,7 +90,7 @@
</div> </div>
<script> <script>
fetch('/sidebar.html') fetch('../html/sidebar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => { .then(data => {
document.getElementById('sidebar-container').innerHTML = data; document.getElementById('sidebar-container').innerHTML = data;
@@ -103,7 +103,7 @@
if (profileLink) profileLink.classList.add('active'); if (profileLink) profileLink.classList.add('active');
}); });
fetch('/topbar.html') fetch('../html/topbar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => document.getElementById('topbar-container').innerHTML = data); .then(data => document.getElementById('topbar-container').innerHTML = data);
</script> </script>
+2 -2
View File
@@ -179,7 +179,7 @@
}); });
// Fetch sidebar and topbar // Fetch sidebar and topbar
fetch('/sidebar.html') fetch('../html/sidebar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => { .then(data => {
document.getElementById('sidebar-container').innerHTML = data; document.getElementById('sidebar-container').innerHTML = data;
@@ -189,7 +189,7 @@
const settingsLink = document.querySelector('#sidebar-container a[href="settings.html"]'); const settingsLink = document.querySelector('#sidebar-container a[href="settings.html"]');
if (settingsLink) settingsLink.classList.add('active'); if (settingsLink) settingsLink.classList.add('active');
}); });
fetch('/topbar.html') fetch('../html/topbar.html')
.then(r => r.text()) .then(r => r.text())
.then(data => document.getElementById('topbar-container').innerHTML = data); .then(data => document.getElementById('topbar-container').innerHTML = data);
</script> </script>
+3 -5
View File
@@ -67,14 +67,12 @@
<!-- Logout bottom --> <!-- Logout bottom -->
<div class="sidebar-bottom"> <div class="sidebar-bottom">
<form action="/api/v1/auth/logout" method="post"> <a href="login.html" class="sidebar-logout">
<button type="submit" class="sidebar-logout">
<div class="logout-left"> <div class="logout-left">
<i class="bi bi-box-arrow-right"></i> <i class="bi bi-box-arrow-right"></i>
<span class="nav-text">Logout</span> <span class="nav-text">Logout</span>
</div> </div>
<i class="bi bi-chevron-right logout-arrow"></i> <i class="bi bi-chevron-right logout-arrow"></i>
</button> </a>
</form>
</div> </div>
</div> </div>