feat: finish forecast rendering and account-authenticated API explorer
This commit is contained in:
@@ -5,7 +5,7 @@ import json
|
||||
from fastapi import Request, Security
|
||||
from fastapi.security import HTTPBearer
|
||||
|
||||
from pigway_frame_flow.core.accounts import session_user
|
||||
from pigway_frame_flow.core.accounts import cookie, session_user
|
||||
from pigway_frame_flow.errors import ErrorCode as E
|
||||
from pigway_frame_flow.errors import FlowError
|
||||
from pigway_frame_flow.storage.database import encode, now_iso
|
||||
@@ -38,7 +38,9 @@ def seed_client(db, token):
|
||||
|
||||
|
||||
def require(scope):
|
||||
def authorize(request: Request, credentials=Security(bearer)):
|
||||
def authorize(
|
||||
request: Request, credentials=Security(bearer), session_cookie=Security(cookie)
|
||||
):
|
||||
db = request.app.state.service.db
|
||||
if not credentials:
|
||||
account = session_user(request)
|
||||
|
||||
Reference in New Issue
Block a user