if params_kw.password != params_kw.cfm_password: return UiError(title='Error', message='Password not match') userid = await get_user() if userid is None: return UiError(title='Error', message='You need login first') ns = { 'id':userid, 'password':params_kw.password } db = DBPools() dbname = await rfexe('get_module_dbname', 'rbac') async with db.sqlorContext(dbname) as sor: await sor.U('users', ns) return UiMessage(title='Success', message='Password reset success') return UiError(title='Error', message='Reset password failed')