mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-20 19:04:40 +01:00
Merge development into plugin-auth
This commit is contained in:
@@ -27,6 +27,13 @@ public interface AuthenticationSystem {
|
||||
*/
|
||||
void resetPassword(String username);
|
||||
|
||||
/**
|
||||
* Called by plugins to internally verify a user's identity.
|
||||
* @param details A unique, one-time token to verify the user.
|
||||
* @return True if the user is verified, False otherwise.
|
||||
*/
|
||||
boolean verifyUser(String details);
|
||||
|
||||
/**
|
||||
* This is the authenticator used for password authentication.
|
||||
* @return An authenticator.
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package emu.grasscutter.auth;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.auth.DefaultAuthenticators.*;
|
||||
import emu.grasscutter.server.http.objects.ComboTokenResJson;
|
||||
import emu.grasscutter.server.http.objects.LoginResultJson;
|
||||
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
/**
|
||||
* The default Grasscutter authentication implementation.
|
||||
* Allows all users to access any account.
|
||||
@@ -22,6 +25,12 @@ public final class DefaultAuthentication implements AuthenticationSystem {
|
||||
public void resetPassword(String username) {
|
||||
// Unhandled. The default authenticator doesn't store passwords.
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean verifyUser(String details) {
|
||||
Grasscutter.getLogger().info(translate("dispatch.authentication.default_unable_to_verify"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authenticator<LoginResultJson> getPasswordAuthenticator() {
|
||||
|
||||
Reference in New Issue
Block a user