Skip to content

Commit e3795eb

Browse files
committed
Inform user about invalid secret key
1 parent 7355143 commit e3795eb

File tree

1 file changed

+6
-0
lines changed
  • Agent/src/main/java/net/lenni0451/authhook

1 file changed

+6
-0
lines changed

Agent/src/main/java/net/lenni0451/authhook/Agent.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ public static void premain(final String args, final Instrumentation instrumentat
1616
private static void hook(final Instrumentation instrumentation) {
1717
try {
1818
Map<String, String> config = Config.load();
19+
if (config.get(Config.SECRET_KEY).contains(" ")) {
20+
System.err.println("Please set a valid secret key in the auth_hook.properties file");
21+
System.err.println("It is automatically generated by ViaProxy if you have the AuthHook plugin installed");
22+
System.exit(-1);
23+
}
24+
1925
instrumentation.addTransformer(new URLRedirector(config), true);
2026
} catch (Throwable t) {
2127
System.err.println("An error occurred while starting AuthHook");

0 commit comments

Comments
 (0)