Dashboard update
This commit is contained in:
18
Machine-Backend/reset_password.py
Normal file
18
Machine-Backend/reset_password.py
Normal file
@ -0,0 +1,18 @@
|
||||
from app import create_app, db
|
||||
from app.models.models import User
|
||||
from werkzeug.security import generate_password_hash
|
||||
|
||||
app = create_app()
|
||||
|
||||
with app.app_context():
|
||||
email = "test@example.com"
|
||||
new_password = "test123"
|
||||
|
||||
user = User.query.filter_by(email=email).first()
|
||||
if not user:
|
||||
print("User not found ❌")
|
||||
else:
|
||||
# Hash password in the way your model expects
|
||||
user.password = generate_password_hash(new_password, method='pbkdf2:sha256')
|
||||
db.session.commit()
|
||||
print(f"Password reset successfully for {email}. Login with: {new_password}")
|
||||
Reference in New Issue
Block a user