|
|
|
@ -66,7 +66,7 @@ public class TwoFactorAuthConfigController extends BaseController { |
|
|
|
" }\n}\n```" + |
|
|
|
ControllerConstants.AVAILABLE_FOR_ANY_AUTHORIZED_USER) |
|
|
|
@GetMapping("/account/settings") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER', 'MFA_CONFIGURATION_TOKEN')") |
|
|
|
public AccountTwoFaSettings getAccountTwoFaSettings() throws ThingsboardException { |
|
|
|
SecurityUser user = getCurrentUser(); |
|
|
|
return twoFaConfigManager.getAccountTwoFaSettings(user.getTenantId(), user).orElse(null); |
|
|
|
@ -125,7 +125,7 @@ public class TwoFactorAuthConfigController extends BaseController { |
|
|
|
"or if the provider is not configured for usage. " + |
|
|
|
ControllerConstants.AVAILABLE_FOR_ANY_AUTHORIZED_USER) |
|
|
|
@PostMapping("/account/config/submit") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER', 'MFA_CONFIGURATION_TOKEN')") |
|
|
|
public void submitTwoFaAccountConfig(@Valid @RequestBody TwoFaAccountConfig accountConfig) throws Exception { |
|
|
|
SecurityUser user = getCurrentUser(); |
|
|
|
twoFactorAuthService.prepareVerificationCode(user, accountConfig, false); |
|
|
|
|