mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-24 11:33:36 +00:00
fix: Re-add handbook_auth.html
its still used by handbook authenticator; i won't judge anyone if they're still loading the handbook
This commit is contained in:
parent
c663b60c1d
commit
3c8d1263e5
@ -150,7 +150,6 @@ public final class Grasscutter {
|
|||||||
httpServer.addRouter(AuthenticationHandler.class);
|
httpServer.addRouter(AuthenticationHandler.class);
|
||||||
httpServer.addRouter(GachaHandler.class);
|
httpServer.addRouter(GachaHandler.class);
|
||||||
httpServer.addRouter(DocumentationServerHandler.class);
|
httpServer.addRouter(DocumentationServerHandler.class);
|
||||||
httpServer.addRouter(HandbookHandler.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the HTTP server should start.
|
// Check if the HTTP server should start.
|
||||||
|
@ -14,6 +14,7 @@ import java.util.*;
|
|||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
/** Handles requests for the new GM Handbook. */
|
/** Handles requests for the new GM Handbook. */
|
||||||
|
@Deprecated(since = "1.7.5-dev")
|
||||||
public final class HandbookHandler implements Router {
|
public final class HandbookHandler implements Router {
|
||||||
private String handbook;
|
private String handbook;
|
||||||
private final boolean serve;
|
private final boolean serve;
|
||||||
|
@ -199,10 +199,10 @@ public final class FileUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] readResource(String resourcePath) {
|
public static byte[] readResource(String resourcePath) {
|
||||||
try (InputStream is = Grasscutter.class.getResourceAsStream(resourcePath)) {
|
try (var is = Grasscutter.class.getResourceAsStream(resourcePath)) {
|
||||||
return is.readAllBytes();
|
return Objects.requireNonNull(is).readAllBytes();
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
Grasscutter.getLogger().warn("Failed to read resource: " + resourcePath);
|
Grasscutter.getLogger().warn("Failed to read resource: {}", resourcePath);
|
||||||
Grasscutter.getLogger().debug("Failed to load resource: " + resourcePath, exception);
|
Grasscutter.getLogger().debug("Failed to load resource: " + resourcePath, exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
46
src/main/resources/html/handbook_auth.html
Normal file
46
src/main/resources/html/handbook_auth.html
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<title>Handbook Authentication</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<script type="application/javascript">
|
||||||
|
if ("{{VALUE}}" === "true") {
|
||||||
|
parent.postMessage({
|
||||||
|
type: "handbook-auth",
|
||||||
|
token: "{{SESSION_TOKEN}}",
|
||||||
|
uid: "{{PLAYER_ID}}"
|
||||||
|
}, "*");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p>Input your Player UID here.</p>
|
||||||
|
<form method="post">
|
||||||
|
<label>
|
||||||
|
<input
|
||||||
|
name="playerid"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="submit" />
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user