mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FEATURE] OAuth type
This commit is contained in:
parent
e5e8fa1463
commit
169df2a79a
2 changed files with 33 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue