邮箱-解密

This commit is contained in:
khalil
2025-03-14 15:43:04 +08:00
parent f6b3eb7863
commit c9e439e5b6
2 changed files with 6 additions and 2 deletions

View File

@@ -1,10 +1,13 @@
package com.accompany.oauth2.support.email;
import com.accompany.common.device.DeviceInfo;
import com.accompany.common.utils.DESUtils;
import com.accompany.core.util.KeyStore;
import com.accompany.oauth2.constant.LoginTypeEnum;
import com.accompany.oauth2.exception.CustomOAuth2Exception;
import com.accompany.oauth2.service.MyUserDetailsService;
import com.accompany.oauth2.util.RequestContextHolderUtils;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.security.authentication.AuthenticationProvider;
@@ -24,10 +27,11 @@ public class EmailAuthenticationProvider implements AuthenticationProvider {
this.userDetailsService = userDetailsService;
}
@SneakyThrows
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
Map<String, ?> params = (Map<String, ?>) authentication.getDetails();
String email = authentication.getName();
String email = DESUtils.DESAndBase64Decrypt(authentication.getName(), KeyStore.DES_ENCRYPT_KEY);
String code = (String) authentication.getCredentials();
DeviceInfo deviceInfo = new DeviceInfo();
try {