mirror of
https://github.com/maubot/maubot
synced 2025-09-07 22:00:39 +00:00
Add /auth/ping and prepare for frontend dev
This commit is contained in:
parent
a584cba794
commit
ec22e5eba7
6 changed files with 41 additions and 6 deletions
|
@ -24,7 +24,7 @@ Handler = Callable[[web.Request], Awaitable[web.Response]]
|
|||
|
||||
@web.middleware
|
||||
async def auth(request: web.Request, handler: Handler) -> web.Response:
|
||||
if request.path.endswith("/login"):
|
||||
if "/auth/" in request.path:
|
||||
return await handler(request)
|
||||
token = request.headers.get("Authorization", "")
|
||||
if not token or not token.startswith("Bearer "):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue