From 5775560933163f79282acf2a1cd882d958131d22 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 8 Dec 2018 14:12:33 +0200 Subject: [PATCH] Actually fix login --- maubot/__meta__.py | 2 +- maubot/management/api/middleware.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/maubot/__meta__.py b/maubot/__meta__.py index 4ae7d5c..c40e5e8 100644 --- a/maubot/__meta__.py +++ b/maubot/__meta__.py @@ -1 +1 @@ -__version__ = "0.1.0.dev11" +__version__ = "0.1.0.dev13" diff --git a/maubot/management/api/middleware.py b/maubot/management/api/middleware.py index f5bd1e4..5f7a788 100644 --- a/maubot/management/api/middleware.py +++ b/maubot/management/api/middleware.py @@ -28,8 +28,8 @@ log = logging.getLogger("maubot.server") @web.middleware async def auth(request: web.Request, handler: Handler) -> web.Response: - subpath = request.path.lstrip(get_config()["server.base_path"]) - if subpath.startswith("auth/") or subpath == "logs": + subpath = request.path[len(get_config()["server.base_path"]):] + if subpath.startswith("/auth/") or subpath == "/logs": return await handler(request) err = check_token(request) if err is not None: