Add /auth/ping and prepare for frontend dev

This commit is contained in:
Tulir Asokan 2018-11-02 15:16:30 +02:00
parent a584cba794
commit ec22e5eba7
6 changed files with 41 additions and 6 deletions

View file

@ -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 "):