feat: service token introduction
This commit is contained in:
@@ -12,6 +12,7 @@ from schemas.user import SubscriptionData, UserInfo
|
||||
router = APIRouter(prefix="/users")
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@router.get("/me", response_model=UserInfo)
|
||||
async def get_me(ctx: AuthContext = Depends(get_auth_context)):
|
||||
return UserInfo(
|
||||
@@ -37,7 +38,11 @@ async def get_subscription(ctx: AuthContext = Depends(get_auth_context)):
|
||||
rw_user = await get_rw_user(get_sdk(), ctx.user.telegram_id, ctx.user.username)
|
||||
|
||||
if not rw_user:
|
||||
logger.critical("RW user not found for existing local subscription (user_id=%d, sub_id=%d)", ctx.user.id, sub.id)
|
||||
logger.critical(
|
||||
"RW user not found for existing local subscription (user_id=%d, sub_id=%d)",
|
||||
ctx.user.id,
|
||||
sub.id,
|
||||
)
|
||||
return SubscriptionData(
|
||||
has_subscription=True,
|
||||
devices=sub.devices,
|
||||
|
||||
Reference in New Issue
Block a user