feat(auth): allow owner to force OTP-only login per user
Team menu «ورود با کد» blocks password login with a clear message and switches the login screen to OTP.
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
UpdateOrgUserDto,
|
||||
UpdateUserCommissionDto,
|
||||
UpdateLogoutTimeDto,
|
||||
UpdateUserLoginOtpOnlyDto,
|
||||
UpdateUserRoleDto,
|
||||
UpdateUserStatusDto,
|
||||
UpdateUserDataAccessDto,
|
||||
@@ -99,6 +100,21 @@ export class UsersController {
|
||||
);
|
||||
}
|
||||
|
||||
@Patch(':id/login-otp-only')
|
||||
@Roles('owner', 'admin')
|
||||
updateLoginOtpOnly(
|
||||
@CurrentUser() user: { organizationId: string; userId: string; role: UserRole },
|
||||
@Param('id') id: string,
|
||||
@Body() dto: UpdateUserLoginOtpOnlyDto,
|
||||
) {
|
||||
return this.usersService.updateLoginOtpOnly(
|
||||
user.organizationId,
|
||||
{ userId: user.userId, role: user.role },
|
||||
id,
|
||||
dto.loginOtpOnly,
|
||||
);
|
||||
}
|
||||
|
||||
@Patch(':id/status')
|
||||
@Roles('owner', 'admin')
|
||||
updateStatus(
|
||||
|
||||
Reference in New Issue
Block a user