Add get_current_user_from_token to auth.py; fix missing import in 3 api files

?token= query-param endpoints (PO/invoice print previews, recipe image exports,
backup download) call get_current_user_from_token which was not ported from the
original archive auth module. Added the function and fixed the missing import in
backup.py, ingredients.py, and invoices.py.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-12 12:34:01 +00:00
parent 907243c2cd
commit ecd63fc65f
4 changed files with 32 additions and 3 deletions

View file

@ -22,7 +22,7 @@ from models.line_item import LineItem
from models.invoice import Invoice
from models.supplier import Supplier
from models.recipe import Recipe, RecipeIngredient, RecipeSubRecipe
from auth import get_current_user, require_cap
from auth import get_current_user, require_cap, get_current_user_from_token
logger = logging.getLogger(__name__)