fix: Telegram DELETE /webhook von Auth nicht mehr ausschließen
AuthMiddleware hat /api/telegram/webhook komplett von der Auth ausgeschlossen – unabhängig von der HTTP-Methode. Dadurch hatte DELETE /api/telegram/webhook kein IsAdmin gesetzt → 403. Fix: Nur POST auf diesen Pfad (= eingehender Telegram-Webhook) wird von der Auth ausgenommen.
This commit is contained in:
1 parent
e5d76bb0a9
commit
dc87bf802a
1 file changed
+2
-1
@@ -18,7 +18,8 @@ public class AuthMiddleware
|
|||||||
var path = ctx.Request.Path.Value ?? "";
|
var path = ctx.Request.Path.Value ?? "";
|
||||||
|
|
||||||
// Static files, login and telegram webhook don't require auth
|
// Static files, login and telegram webhook don't require auth
|
||||||
if (!path.StartsWith("/api/") || path == "/api/auth/login" || path == "/api/telegram/webhook")
|
var isTelegramWebhook = path == "/api/telegram/webhook" && ctx.Request.Method == "POST";
|
||||||
|
if (!path.StartsWith("/api/") || path == "/api/auth/login" || isTelegramWebhook)
|
||||||
{
|
{
|
||||||
await _next(ctx);
|
await _next(ctx);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in new issue
Block a user