rbac/wwwroot/userpassword_login.dspy
2025-01-21 13:49:26 +08:00

12 lines
389 B
Plaintext

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