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() async with db.sqlorContext('sage') as sor: await sor.U('users', ns) return UiMessage(title='Success', message='Password reset success') return UiError(title='Error', message='Reset password failed')