fix login api

This commit is contained in:
behruz-dev
2025-07-29 13:20:31 +05:00
parent a855846a55
commit a697c6a6a3
4 changed files with 8 additions and 6 deletions

View File

@@ -56,7 +56,9 @@ class ConfirUserApiView(generics.GenericAPIView):
data = get_user_creadentials(phone)
if not data:
return error_message("Not found", 404)
user = User.objects.create_user(phone=data['phone'], password=data['password'])
user = User.objects.create_user(phone=data['phone'])
user.set_password(data['password'])
user.save()
confirmation.is_verify = True
confirmation.save()
token = RefreshToken.for_user(user)