mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-26 18:39:56 +08:00
Add Dispatch Password authentication
This commit is contained in:
committed by
Luke H-W
Unverified
parent
42e3af4e39
commit
bc2c5deb48
@@ -6,6 +6,7 @@ import emu.grasscutter.game.Account;
|
||||
import emu.grasscutter.server.http.objects.ComboTokenResJson;
|
||||
import emu.grasscutter.server.http.objects.LoginResultJson;
|
||||
|
||||
import static emu.grasscutter.Configuration.ACCOUNT;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
/**
|
||||
@@ -13,12 +14,20 @@ import static emu.grasscutter.utils.Language.translate;
|
||||
* Allows all users to access any account.
|
||||
*/
|
||||
public final class DefaultAuthentication implements AuthenticationSystem {
|
||||
private final Authenticator<LoginResultJson> passwordAuthenticator = new PasswordAuthenticator();
|
||||
private final Authenticator<LoginResultJson> tokenAuthenticator = new TokenAuthenticator();
|
||||
private final Authenticator<ComboTokenResJson> sessionKeyAuthenticator = new SessionKeyAuthenticator();
|
||||
private final ExternalAuthenticator externalAuthenticator = new ExternalAuthentication();
|
||||
private final OAuthAuthenticator oAuthAuthenticator = new OAuthAuthentication();
|
||||
|
||||
private Authenticator<LoginResultJson> passwordAuthenticator;
|
||||
private Authenticator<LoginResultJson> tokenAuthenticator = new TokenAuthenticator();
|
||||
private Authenticator<ComboTokenResJson> sessionKeyAuthenticator = new SessionKeyAuthenticator();
|
||||
private ExternalAuthenticator externalAuthenticator = new ExternalAuthentication();
|
||||
private OAuthAuthenticator oAuthAuthenticator = new OAuthAuthentication();
|
||||
|
||||
public DefaultAuthentication() {
|
||||
if(ACCOUNT.EXPERIMENTAL_RealPassword) {
|
||||
passwordAuthenticator = new ExperimentalPasswordAuthenticator();
|
||||
} else {
|
||||
passwordAuthenticator = new PasswordAuthenticator();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createAccount(String username, String password) {
|
||||
// Unhandled. The default authenticator doesn't store passwords.
|
||||
|
||||
Reference in New Issue
Block a user