username = params_kw.get('username') passwd = params_kw.get('password') if not passwd: return Error(title='Login failed', message='Password is required') passwd = password(passwd) rzt = await check_user_password(username, passwd): if rzt: return Message(title='Logined', message=f'Welcome back {get_usernme()}') return Error(title='login failed', message='user and password mismatch')