From ec7d7e1da9fe25e5e67e3b85d274cd49a9667481 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Fri, 2 Jan 2026 20:34:02 +0100 Subject: [PATCH] fix: use AuthService for password operations in profile API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- app/api/v1/shop/profile.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/api/v1/shop/profile.py b/app/api/v1/shop/profile.py index d6d11fa9..cc135dcf 100644 --- a/app/api/v1/shop/profile.py +++ b/app/api/v1/shop/profile.py @@ -13,8 +13,8 @@ from sqlalchemy.orm import Session from app.api.deps import get_current_customer_api from app.core.database import get_db -from app.core.security import get_password_hash, verify_password from app.exceptions import ValidationException +from app.services.auth_service import AuthService from models.database.customer import Customer from models.schema.customer import ( CustomerPasswordChange, @@ -22,6 +22,9 @@ from models.schema.customer import ( CustomerUpdate, ) +# Auth service for password operations +auth_service = AuthService() + router = APIRouter() logger = logging.getLogger(__name__) @@ -135,7 +138,9 @@ def change_password( ) # Verify current password - if not verify_password(password_data.current_password, customer.hashed_password): + if not auth_service.auth_manager.verify_password( + password_data.current_password, customer.hashed_password + ): raise ValidationException("Current password is incorrect") # Verify passwords match @@ -147,7 +152,7 @@ def change_password( raise ValidationException("New password must be different from current password") # Update password - customer.hashed_password = get_password_hash(password_data.new_password) + customer.hashed_password = auth_service.hash_password(password_data.new_password) db.commit() logger.info(