Bootstrap Micropub support, and start support for Update activities

This commit is contained in:
Thomas Sileo 2022-07-17 18:43:08 +02:00
parent fb5759cfc1
commit 6f25d06bbb
11 changed files with 279 additions and 16 deletions

View file

@ -292,6 +292,13 @@ async def verify_access_token(
db_session: AsyncSession = Depends(get_db_session),
) -> AccessTokenInfo:
token = request.headers.get("Authorization", "").removeprefix("Bearer ")
# Check if the token is within the form data
if not token:
form_data = await request.form()
if "access_token" in form_data:
token = form_data.get("access_token")
is_token_valid, access_token = await _check_access_token(db_session, token)
if not is_token_valid:
raise HTTPException(