Update Login URL handling and optimize ShadowJar build process

- Fix `resolveLogin` method to ensure correct login endpoint formatting.
- Update default `LOGIN_CODE_ENDPOINT` in `Config` to reflect new API path.
- Adjust ShadowJar build to transform SLF4J service files and exclude SLF4J dependencies during minimization.
This commit is contained in:
akastijn 2025-07-31 23:05:06 +02:00
parent 4e66e00eae
commit f42777c62a
3 changed files with 11 additions and 5 deletions

View File

@ -45,7 +45,13 @@ tasks.withType<ShadowJar> {
relocate("kotlin", "com.alttd.webinterface.shaded.kotlin")
relocate("org.eclipse.jetty", "com.alttd.webinterface.shaded.org.eclipse.jetty")
minimize()
// Transform service files for SLF4J to use the relocated packages
transform(com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer::class.java)
minimize {
// Exclude SLF4J to prevent minimization from removing required classes
exclude(dependency("org.slf4j:.*:.*"))
}
}
tasks.build {

View File

@ -70,7 +70,7 @@ public class Login {
private @NotNull String resolveLogin(String message, String loginCode) {
return message
.replace("<login_endpoint>", Config.LOGIN_ENDPOINT)
.replace("<login_endpoint>", Config.LOGIN_ENDPOINT + "/")
.replace("<code>", loginCode);
}
}

View File

@ -192,14 +192,14 @@ public final class Config {
APPEAL_MESSAGE = getString("messages.appeal-message", APPEAL_MESSAGE);
}
public static String YOUR_LOGIN_CODE = "<green>Log in on <gold><click:open_url:'<login_endpoint>/<code>'>alttd.com</click>" +
"</gold> with code: <code></green>";
public static String YOUR_LOGIN_CODE = "<green>Log in on <gold><click:open_url:'<login_endpoint><code>'>" +
"alttd.com</click></gold> with code: <code></green>";
private static void login_messages() {
YOUR_LOGIN_CODE = getString("messages.your-login-code", YOUR_LOGIN_CODE);
}
public static String LOGIN_CODE_ENDPOINT = "https://alttd.com/login/requestNewUserLogin/<uuid>";
public static String LOGIN_CODE_ENDPOINT = "https://alttd.com/api/login/requestNewUserLogin/<uuid>";
public static String LOGIN_ENDPOINT = "https://alttd.com/login";
public static String DOWNLOAD_ENDPOINT = "https://alttd.com/particles/download";
public static String SECRET = "";