[FEATURE] OAuth type

This commit is contained in:
Gravita 2021-04-13 14:52:21 +07:00
parent e5e8fa1463
commit 169df2a79a
2 changed files with 33 additions and 0 deletions

View file

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

View file

@ -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;
}
}