[FIX] WebView auth

This commit is contained in:
Gravita 2021-05-28 04:40:37 +07:00
parent c2f55998e3
commit 6c966b6126
5 changed files with 22 additions and 0 deletions

View file

@ -3,6 +3,7 @@
import pro.gravit.launcher.ClientPermissions;
import pro.gravit.launchserver.dao.User;
@Deprecated
public class AuthProviderDAOResult extends AuthProviderResult {
public User daoObject;

View file

@ -35,6 +35,7 @@ public void init(LaunchServer srv) {
if (url == null) throw new RuntimeException("[Verify][AuthProvider] url cannot be null");
if (response == null) throw new RuntimeException("[Verify][AuthProvider] response cannot be null");
pattern = Pattern.compile(response);
}
@Override

View file

@ -184,6 +184,9 @@ public void init(LaunchServer.ReloadType type) {
Launcher.applyLauncherEnv(env);
for (Map.Entry<String, AuthProviderPair> provider : auth.entrySet()) {
provider.getValue().init(server, provider.getKey());
if (!provider.getValue().isUseCore()) {
logger.warn("Deprecated auth {}: legacy provider/handler auth may be removed in future release", provider.getKey());
}
}
if (dao != null) {
server.registerObject("dao", dao);

View file

@ -77,6 +77,7 @@ public static void registerProviders() {
providers.register("signature", AuthSignaturePassword.class);
providers.register("totp", AuthTOTPPassword.class);
providers.register("oauth", AuthOAuthPassword.class);
providers.register("code", AuthCodePassword.class);
registerProviders = true;
}
}

View file

@ -0,0 +1,16 @@
package pro.gravit.launcher.request.auth.password;
import pro.gravit.launcher.request.auth.AuthRequest;
public class AuthCodePassword implements AuthRequest.AuthPasswordInterface {
public final String code;
public AuthCodePassword(String code) {
this.code = code;
}
@Override
public boolean check() {
return true;
}
}