邮箱-解密
This commit is contained in:
@@ -105,7 +105,7 @@ public class EmailService extends BaseService {
|
||||
RBucket<String> codeBucket = redissonClient.getBucket(codeKey);
|
||||
String codeCache = codeBucket.get();
|
||||
|
||||
logger.info("verifySmsCode codeKey : {}, codeCache : {} code : {}", codeKey, codeCache, code);
|
||||
logger.info("verifyEmailCode codeKey : {}, codeCache : {} code : {}", codeKey, codeCache, code);
|
||||
if (StringUtils.equalsIgnoreCase(codeCache, code)) {
|
||||
return codeBucket.delete();
|
||||
}
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user