fix: Cleaning up the code base
This commit is contained in:
@@ -13,32 +13,3 @@ router = APIRouter()
|
||||
@router.get("/ping", tags=["Test"])
|
||||
def ping():
|
||||
return {"message": "pong"}
|
||||
|
||||
# =========================
|
||||
# EXEMPLE UTILISATEUR
|
||||
# =========================
|
||||
@router.get("/me", tags=["User"])
|
||||
def read_current_user(current_user: dict = Depends(get_current_user)):
|
||||
"""
|
||||
Retourne les infos de l'utilisateur connecté
|
||||
"""
|
||||
return {"user": current_user}
|
||||
|
||||
# =========================
|
||||
# EXEMPLE AUTH
|
||||
# =========================
|
||||
@router.post("/hash-password", tags=["Auth"])
|
||||
def test_hash_password(password: str):
|
||||
"""
|
||||
Exemple simple pour hasher un mot de passe
|
||||
"""
|
||||
hashed = hash_password(password)
|
||||
return {"password": password, "hashed": hashed}
|
||||
|
||||
@router.post("/verify-password", tags=["Auth"])
|
||||
def test_verify_password(password: str, hashed: str):
|
||||
"""
|
||||
Vérifie qu'un mot de passe correspond à un hash
|
||||
"""
|
||||
valid = verify_password(password, hashed)
|
||||
return {"valid": valid}
|
||||
|
||||
Reference in New Issue
Block a user