mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FIX] WebView auth
This commit is contained in:
parent
c2f55998e3
commit
6c966b6126
5 changed files with 22 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
import pro.gravit.launcher.ClientPermissions;
|
||||
import pro.gravit.launchserver.dao.User;
|
||||
|
||||
@Deprecated
|
||||
public class AuthProviderDAOResult extends AuthProviderResult {
|
||||
public User daoObject;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue