mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-01-07 01:21:22 -05:00
fix: Remove API Tokens from User APIs (#4985)
This commit is contained in:
@@ -10,6 +10,7 @@ from .user import (
|
||||
GroupInDB,
|
||||
GroupPagination,
|
||||
GroupSummary,
|
||||
LongLiveTokenCreateResponse,
|
||||
LongLiveTokenIn,
|
||||
LongLiveTokenInDB,
|
||||
LongLiveTokenOut,
|
||||
@@ -57,6 +58,7 @@ __all__ = [
|
||||
"GroupInDB",
|
||||
"GroupPagination",
|
||||
"GroupSummary",
|
||||
"LongLiveTokenCreateResponse",
|
||||
"LongLiveTokenIn",
|
||||
"LongLiveTokenInDB",
|
||||
"LongLiveTokenOut",
|
||||
|
||||
@@ -31,7 +31,6 @@ class LongLiveTokenIn(MealieModel):
|
||||
|
||||
|
||||
class LongLiveTokenOut(MealieModel):
|
||||
token: str
|
||||
name: str
|
||||
id: int
|
||||
created_at: datetime | None = None
|
||||
@@ -42,6 +41,12 @@ class LongLiveTokenOut(MealieModel):
|
||||
return [joinedload(LongLiveToken.user)]
|
||||
|
||||
|
||||
class LongLiveTokenCreateResponse(LongLiveTokenOut):
|
||||
"""Should ONLY be used when creating a new token, as the token field is sensitive"""
|
||||
|
||||
token: str
|
||||
|
||||
|
||||
class CreateToken(LongLiveTokenIn):
|
||||
user_id: UUID4
|
||||
token: str
|
||||
|
||||
Reference in New Issue
Block a user