-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset-test-password.py
More file actions
36 lines (32 loc) · 1.03 KB
/
reset-test-password.py
File metadata and controls
36 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python3
"""Reset test user password"""
import sys
sys.path.insert(0, '/Users/daniel.yeam/repos/_yeam-app-winebrt/backend')
from app.database import SessionLocal
from app.models import User
from passlib.context import CryptContext
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
db = SessionLocal()
# Get test user
test_user = db.query(User).filter(User.username == "test").first()
if test_user:
# Update password to test123!
test_user.hashed_password = pwd_context.hash("test123!")
db.commit()
print("✅ Password for 'test' user reset to: test123!")
print(" Username: test")
print(" Password: test123!")
else:
print("❌ Test user not found. Creating new one...")
new_user = User(
username="test",
email="test@example.com",
hashed_password=pwd_context.hash("test123!"),
full_name="Test User"
)
db.add(new_user)
db.commit()
print("✅ Test user created!")
print(" Username: test")
print(" Password: test123!")
db.close()