diff --git a/backend/server.py b/backend/server.py index 08e3a5e..e801aa9 100644 --- a/backend/server.py +++ b/backend/server.py @@ -64,7 +64,7 @@ async def startup_db_client(): admin_data = { "id": "admin-1", "email": "admin@epictravel.com", - "password_hash": hash_password("admin123"), + "password_hash": hash_password("Joker1974!!!"), "created_at": datetime.utcnow() } await db.admin_users.insert_one(admin_data) diff --git a/backend/update_admin_password.py b/backend/update_admin_password.py new file mode 100644 index 0000000..87b2dcb --- /dev/null +++ b/backend/update_admin_password.py @@ -0,0 +1,41 @@ +import asyncio +from motor.motor_asyncio import AsyncIOMotorClient +from passlib.context import CryptContext +import os +from dotenv import load_dotenv +from pathlib import Path + +# Load environment variables +ROOT_DIR = Path(__file__).parent +load_dotenv(ROOT_DIR / '.env') + +# Password hashing +pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") + +async def update_admin_password(): + # Connect to MongoDB + mongo_url = os.environ['MONGO_URL'] + client = AsyncIOMotorClient(mongo_url) + db = client[os.environ['DB_NAME']] + + # New password + new_password = "Joker1974!!!" + new_password_hash = pwd_context.hash(new_password) + + # Update admin password + result = await db.admin_users.update_one( + {"email": "admin@epictravel.com"}, + {"$set": {"password_hash": new_password_hash}} + ) + + if result.modified_count > 0: + print(f"✓ Admin password updated successfully!") + print(f"✓ Email: admin@epictravel.com") + print(f"✓ New Password: {new_password}") + else: + print("✗ Failed to update password or admin user not found") + + client.close() + +if __name__ == "__main__": + asyncio.run(update_admin_password()) diff --git a/frontend/src/pages/AdminLogin.jsx b/frontend/src/pages/AdminLogin.jsx index 7721929..896f1d6 100644 --- a/frontend/src/pages/AdminLogin.jsx +++ b/frontend/src/pages/AdminLogin.jsx @@ -83,7 +83,7 @@ const AdminLogin = () => {
Demo Credentials:
Email: admin@epictravel.com
- Password: admin123
+ Password: Joker1974!!!