Browse Source

long cast

master
gsd 2 weeks ago
parent
commit
26e1d8ba0d
  1. 5
      src/main/java/app/annotations/impl/WebAccessAspect.java
  2. 1
      src/main/java/app/services/db/DiscordAuthService.java

5
src/main/java/app/annotations/impl/WebAccessAspect.java

@ -48,11 +48,6 @@ public class WebAccessAspect {
} }
} }
@Before("@annotation(app.annotations.interfaces.CheckWebAccess) && args(session)")
public void beforeWS(JoinPoint joinPoint, WebSocketSession session) throws IOException {
before(joinPoint, session);
}
@Before("@annotation(app.annotations.interfaces.CheckWebAccess) && args(session,..)") @Before("@annotation(app.annotations.interfaces.CheckWebAccess) && args(session,..)")
public void before(JoinPoint joinPoint, WebSocketSession session) throws IOException { public void before(JoinPoint joinPoint, WebSocketSession session) throws IOException {
AuthMethod auth_method = ((MethodSignature) joinPoint.getSignature()).getMethod().getAnnotation(CheckWebAccess.class).auth_method(); AuthMethod auth_method = ((MethodSignature) joinPoint.getSignature()).getMethod().getAnnotation(CheckWebAccess.class).auth_method();

1
src/main/java/app/services/db/DiscordAuthService.java

@ -67,6 +67,7 @@ public class DiscordAuthService {
return jdbcTemplate.query("select account_id from user_messages where extract(epoch from now()) - utime < 300 and message like ? order by id asc limit 1", return jdbcTemplate.query("select account_id from user_messages where extract(epoch from now()) - utime < 300 and message like ? order by id asc limit 1",
new Object[]{uuid.toString()}, (rs, n) -> rs.getLong("account_id")) new Object[]{uuid.toString()}, (rs, n) -> rs.getLong("account_id"))
.stream() .stream()
.map("[U:1:%s]"::formatted)
.map(SteamIDConverter::getSteamID) .map(SteamIDConverter::getSteamID)
.findFirst().orElse(null); .findFirst().orElse(null);
} }

Loading…
Cancel
Save