mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 17:05:20 +01:00
Add verifyUser to AuthenticationHandler
This commit is contained in:
@@ -12,5 +12,12 @@ public interface AuthenticationHandler {
|
||||
void handleRegister(Request req, Response res);
|
||||
void handleChangePassword(Request req, Response res);
|
||||
|
||||
/**
|
||||
* Other plugins may need to verify a user's identity using details from handleLogin()
|
||||
* @param details The user's unique one-time token that needs to be verified
|
||||
* @return If the verification was successful
|
||||
*/
|
||||
boolean verifyUser(String details);
|
||||
|
||||
LoginResultJson handleGameLogin(Request req, LoginAccountRequestJson requestData);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,12 @@ public class DefaultAuthenticationHandler implements AuthenticationHandler {
|
||||
res.send("Authentication is not available with the default authentication method");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verifyUser(String details) {
|
||||
Grasscutter.getLogger().info(translate("dispatch.authentication.default_unable_to_verify"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoginResultJson handleGameLogin(Request req, LoginAccountRequestJson requestData) {
|
||||
LoginResultJson responseData = new LoginResultJson();
|
||||
|
||||
Reference in New Issue
Block a user