Spaces:
3SCError404
/
Paused

nexus / scratch /reset_super.py
dushyantsingh0
backend stabilization
3143c25
Raw History Blame Contribute Delete
723 Bytes
import asyncio
from sqlalchemy import select
from core.database import async_session_factory
from core.security import get_password_hash
from models.user import User
async def reset_super_pass():
async with async_session_factory() as db:
stmt = select(User).where(User.email == "admin@3sc.com")
res = await db.execute(stmt)
user = res.scalar_one_or_none()
if user:
user.hashed_password = get_password_hash("password123")
db.add(user)
await db.commit()
print("Password reset for admin@3sc.com to password123")
else:
print("User admin@3sc.com not found")
if __name__ == "__main__":
asyncio.run(reset_super_pass())