add: route get verification status
All checks were successful
Build and Deploy / deploy (push) Successful in 21s
All checks were successful
Build and Deploy / deploy (push) Successful in 21s
This commit is contained in:
@ -125,3 +125,7 @@ async def verify_code(verify_code: VerifyCode):
|
|||||||
@router.post("/auth/generate_code")
|
@router.post("/auth/generate_code")
|
||||||
async def generate_code(username: str):
|
async def generate_code(username: str):
|
||||||
return await AuthService().generate_code(username)
|
return await AuthService().generate_code(username)
|
||||||
|
|
||||||
|
@router.get("/auth/verification_status/{username}")
|
||||||
|
async def get_verification_status(username: str):
|
||||||
|
return await AuthService().get_verification_status(username)
|
||||||
|
@ -82,6 +82,12 @@ class AuthService:
|
|||||||
}}
|
}}
|
||||||
)
|
)
|
||||||
return {"status": "success"}
|
return {"status": "success"}
|
||||||
|
|
||||||
|
async def get_verification_status(self, username: str):
|
||||||
|
user = await users_collection.find_one({"username": username})
|
||||||
|
if not user:
|
||||||
|
raise HTTPException(404, "User not found")
|
||||||
|
return {"is_verified": user["is_verified"]}
|
||||||
|
|
||||||
async def login(self, credentials: UserLogin):
|
async def login(self, credentials: UserLogin):
|
||||||
# Ищем пользователя
|
# Ищем пользователя
|
||||||
|
Reference in New Issue
Block a user