ciyidogan commited on
Commit
869b0c9
·
verified ·
1 Parent(s): f04c960

Update auth_controller.py

Browse files
Files changed (1) hide show
  1. auth_controller.py +1 -2
auth_controller.py CHANGED
@@ -1,6 +1,7 @@
1
  from fastapi import APIRouter, HTTPException, Request
2
  import bcrypt
3
  from service_config import ServiceConfig
 
4
 
5
  router = APIRouter()
6
  service_config = ServiceConfig()
@@ -37,9 +38,7 @@ async def change_password(request: Request):
37
  new_hash = bcrypt.hashpw(new_password.encode(), bcrypt.gensalt()).decode()
38
  user["password_hash"] = new_hash
39
 
40
- # Config'i kaydet (burada basitçe dosyaya yazılması gerekir)
41
  with open(service_config.config_path, "w", encoding="utf-8") as f:
42
- import json
43
  json.dump(service_config, f, indent=2)
44
 
45
  return {"message": "Password updated successfully"}
 
1
  from fastapi import APIRouter, HTTPException, Request
2
  import bcrypt
3
  from service_config import ServiceConfig
4
+ import json
5
 
6
  router = APIRouter()
7
  service_config = ServiceConfig()
 
38
  new_hash = bcrypt.hashpw(new_password.encode(), bcrypt.gensalt()).decode()
39
  user["password_hash"] = new_hash
40
 
 
41
  with open(service_config.config_path, "w", encoding="utf-8") as f:
 
42
  json.dump(service_config, f, indent=2)
43
 
44
  return {"message": "Password updated successfully"}