# Conflicts:
#	src/main/java/org/ccalm/jwt/SecurityConfig.java
This commit is contained in:
2025-03-09 19:52:57 +05:00
6 changed files with 10 additions and 157 deletions

View File

@ -480,7 +480,7 @@ public class MainController implements ServletContextAware {
String sql = """
select
name1
name
from
main.get_access_list(:user_id)
where
@ -667,7 +667,7 @@ public class MainController implements ServletContextAware {
//parameters.addValue("phone",);
parameters.addValue("email",newUserModel.getEmail());
parameters.addValue("e_iin",newUserModel.getIin()); //Для ЭЦП это поле обязательно
parameters.addValue("key",newUserModel.getIin());
parameters.addValue("key",personal_data_key);
parameters.addValue("password",password);
ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper());
@ -866,7 +866,7 @@ public class MainController implements ServletContextAware {
}catch (DataAccessException ex){
String uuid = UUID.randomUUID().toString();
logger.error(uuid,ex);
throw new CustomException(10000, trt.trt("Error_executing_SQL_query"),uuid);
throw new CustomException(10000, trt.trt("Internal_Server_Error"),uuid);
}
if(json==null) {
String msg = trt.trt("Invalid_username_and_or_password");
@ -1082,8 +1082,8 @@ public class MainController implements ServletContextAware {
}
}catch (DataAccessException ex){
java.lang.String uuid = UUID.randomUUID().toString();
logger.error("Error executing SQL query", uuid, ex);
throw new CustomException(10000, trt.trt("Error_executing_SQL_query"),uuid);
logger.error(uuid, ex);
throw new CustomException(10000, trt.trt("Internal_Server_Error"),uuid);
}catch (Exception e) {
String uuid = UUID.randomUUID().toString();
logger.error(uuid,e);
@ -1259,12 +1259,8 @@ public class MainController implements ServletContextAware {
@RequestMapping(value = "/logout",method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json;charset=utf-8")
@ResponseBody
public String logout(HttpServletResponse response,HttpServletRequest request) {
//Устанавливает куки
setAccessCookie(response,"");
setRefreshCookie(response, request, "");
return createStrJSONError(0,"",(String)null,(String)null);
}
//------------------------------------------------------------------------------------------------------------------
@ -1651,20 +1647,7 @@ public class MainController implements ServletContextAware {
throw new CustomException(10000, Collections.singletonList(trt.trt("Please_log_in")),null);
}
UserDetails userDetails = (UserDetails) authentication.getPrincipal();
/*if(jwt_a.isEmpty() || countOccurrences(jwt_a, '.')!=2)
{
throw new CustomException(10000, Collections.singletonList(trt.trt("Please_log_in")),null);
}
//Checking the token signature
Jws<Claims> claims = null;
try {
claims = Jwts.parserBuilder()
.setSigningKey(getPublicKey()) //.setSigningKey(key_a)
.build()
.parseClaimsJws(jwt_a);
} catch (Exception e) {
throw new CustomException(10000, Arrays.asList(trt.trt("Please_log_in"), trt.trt("JWT_token_verification_error")),null);
}*/
//If this is a repeat authorization, then we inform the client about it
String result=null;
try(Cache cache = new Cache(redis_host,redis_port,redis_password)) {

View File

@ -12,7 +12,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class Cache implements AutoCloseable {
private static final Logger logger = LogManager.getLogger(Cache.class);
@ -60,4 +59,4 @@ public class Cache implements AutoCloseable {
public void delete(String key) {
jedis.del(key.getBytes());
}
}
}