diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java index 256bf190..c3b1bbd0 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java @@ -75,6 +75,7 @@ public static void registerProviders() { providers.register("2fa", Auth2FAPassword.class); providers.register("signature", AuthSignaturePassword.class); providers.register("totp", AuthTOTPPassword.class); + providers.register("oauth", AuthOAuthPassword.class); registerProviders = true; } } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthOAuthPassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthOAuthPassword.java new file mode 100644 index 00000000..9c72e5b0 --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthOAuthPassword.java @@ -0,0 +1,32 @@ +package pro.gravit.launcher.request.auth.password; + +import pro.gravit.launcher.request.auth.AuthRequest; + +public class AuthOAuthPassword implements AuthRequest.AuthPasswordInterface { + public final String accessToken; + public final String refreshToken; + public final int expire; + + public AuthOAuthPassword(String accessToken, String refreshToken, int expire) { + this.accessToken = accessToken; + this.refreshToken = refreshToken; + this.expire = expire; + } + + public AuthOAuthPassword(String accessToken, int expire) { + this.accessToken = accessToken; + this.refreshToken = null; + this.expire = expire; + } + + public AuthOAuthPassword(String accessToken) { + this.accessToken = accessToken; + this.refreshToken = null; + this.expire = 0; + } + + @Override + public boolean check() { + return true; + } +}