mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-10 21:12:57 +08:00
Add verifyUser to AuthenticationHandler
This commit is contained in:
parent
9ed1bb9b94
commit
c932f9c7e5
@ -12,5 +12,12 @@ public interface AuthenticationHandler {
|
|||||||
void handleRegister(Request req, Response res);
|
void handleRegister(Request req, Response res);
|
||||||
void handleChangePassword(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);
|
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");
|
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
|
@Override
|
||||||
public LoginResultJson handleGameLogin(Request req, LoginAccountRequestJson requestData) {
|
public LoginResultJson handleGameLogin(Request req, LoginAccountRequestJson requestData) {
|
||||||
LoginResultJson responseData = new LoginResultJson();
|
LoginResultJson responseData = new LoginResultJson();
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
"no_keystore_error": "[Dispatch] No SSL cert found! Falling back to HTTP server.",
|
"no_keystore_error": "[Dispatch] No SSL cert found! Falling back to HTTP server.",
|
||||||
"default_password": "[Dispatch] The default keystore password was loaded successfully. Please consider setting the password to 123456 in config.json."
|
"default_password": "[Dispatch] The default keystore password was loaded successfully. Please consider setting the password to 123456 in config.json."
|
||||||
},
|
},
|
||||||
|
"authentication": {
|
||||||
|
"default_unable_to_verify": "[Authentication] Something called the verifyUser method which is unavailable in the default authentication handler"
|
||||||
|
},
|
||||||
"no_commands_error": "Commands are not supported in dispatch only mode.",
|
"no_commands_error": "Commands are not supported in dispatch only mode.",
|
||||||
"unhandled_request_error": "[Dispatch] Potential unhandled %s request: %s",
|
"unhandled_request_error": "[Dispatch] Potential unhandled %s request: %s",
|
||||||
"account": {
|
"account": {
|
||||||
|
Loading…
Reference in New Issue
Block a user