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:
2026-10-22 15:43:24 +03:30
parent 80fb5bf1bb
commit 65cf4e9a66
9 changed files with 181 additions and 11 deletions
+16
View File
@@ -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(