mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-22 01:39:51 +08:00
Implement proper handbook authentication (pt. 1)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package emu.grasscutter.auth;
|
||||
|
||||
import emu.grasscutter.auth.AuthenticationSystem.AuthenticationRequest;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
/** Handles player authentication for the web GM handbook. */
|
||||
public interface HandbookAuthenticator {
|
||||
@Getter @Builder
|
||||
class Response {
|
||||
private final int status;
|
||||
private final String body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked when the user requests to authenticate.
|
||||
* This should respond with a page that allows the user to authenticate.
|
||||
*
|
||||
* @route GET /handbook/authenticate
|
||||
* @param request The authentication request.
|
||||
*/
|
||||
void presentPage(AuthenticationRequest request);
|
||||
|
||||
/**
|
||||
* Invoked when the user requests to authenticate.
|
||||
* This is called when the user submits the authentication form.
|
||||
* This should respond with HTML that sends a message to the GM Handbook.
|
||||
* See the default handbook authentication page for an example.
|
||||
*
|
||||
* @param request The authentication request.
|
||||
* @return The response to send to the client.
|
||||
*/
|
||||
Response authenticate(AuthenticationRequest request);
|
||||
}
|
||||
Reference in New Issue
Block a user