Admin: Login-Link mit window.location.origin statt Server-Host

- Backend gibt nur Token zurück statt fertigen Link
- Frontend baut Link via window.location.origin zusammen
- Zeigt korrekte Domain/Port statt internes http://127.0.0.1

Backend:
- AdminEndpoint: POST /api/admin/users/{userId}/login-link gibt { token }
- AuthEndpoint: GET /api/auth/autologin?token=xxx setzt Cookie + redirect
- AuthMiddleware: autologin-Route von Auth ausgenommen

Frontend:
- api.js: apiAdminGetLoginLink() Funktion
- admin-page.js: Login-as-User Button → Login-Link Button mit Modal
- form.css: Styling für Login-Link Modal
This commit is contained in:
Meleki committed 2026-03-06 14:35:01 +01:00
1 parent eeecd3da62
commit 1b9cc29421
6 files changed
+184 -17

No files matched your search

+2 -1
View File
@@ -20,7 +20,8 @@ public class AuthMiddleware
// Static files, login and telegram webhook don't require auth
var isTelegramWebhook = path.StartsWith("/api/telegram/webhook/") && ctx.Request.Method == "POST";
var isSharedGet = path.StartsWith("/api/shared/") && ctx.Request.Method == "GET";
if (!path.StartsWith("/api/") || path == "/api/auth/login" || isTelegramWebhook || isSharedGet)
var isAutologin = path == "/api/auth/autologin" && ctx.Request.Method == "GET";
if (!path.StartsWith("/api/") || path == "/api/auth/login" || isTelegramWebhook || isSharedGet || isAutologin)
{
await _next(ctx);
return;