Add call for Facebook logins

This commit is contained in:
KingRainbow44 2023-05-14 00:45:01 -04:00
parent 418422577a
commit 2ff5dbbc1c
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -1,7 +1,5 @@
package emu.grasscutter.server.http.dispatch;
import static emu.grasscutter.utils.Language.translate;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.auth.AuthenticationSystem;
import emu.grasscutter.auth.OAuthAuthenticator.ClientType;
@ -14,6 +12,8 @@ import emu.grasscutter.utils.JsonUtils;
import io.javalin.Javalin;
import io.javalin.http.Context;
import static emu.grasscutter.utils.Language.translate;
/** Handles requests related to authentication. (aka dispatch) */
public final class DispatchHandler implements Router {
/**
@ -142,6 +142,13 @@ public final class DispatchHandler implements Router {
Grasscutter.getAuthenticationSystem()
.getOAuthAuthenticator()
.handleTokenProcess(AuthenticationSystem.fromExternalRequest(ctx)));
javalin.get(
"/sdkFacebookLogin.html",
ctx ->
Grasscutter.getAuthenticationSystem()
.getOAuthAuthenticator()
.handleRedirection(
AuthenticationSystem.fromExternalRequest(ctx), ClientType.DESKTOP));
javalin.get(
"/Api/twitter_login",
ctx ->