mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2025-06-05 21:59:23 +02:00
Bootstrap Micropub support, and start support for Update activities
This commit is contained in:
@ -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(
|
||||
|
Reference in New Issue
Block a user