async def create_account(request: Request): trusted_origin(request) if not get_settings().beta_signups_open: raise HTTPException(503, "Beta registration is currently closed.") await throttle(request, "signup-ip", peer_id(request), 5, 3600) body = await read_json(request, s.AccountInput, 4096) password_hash = await password_work(request, hash_password, body.password) async with session() as db: db.add(m.BetaAccount(email=body.email, display_name=body.display_name, password_hash=password_hash)) try: await db.commit() except IntegrityError: await db.rollback() return {"message": "If these details can be registered, the account is ready. Sign in to continue."}