feat: adding real debrid user auth

This commit is contained in:
Chubby Granny Chaser 2024-05-28 14:01:28 +01:00
parent 86816dc3c3
commit 183b85d66a
No known key found for this signature in database
24 changed files with 234 additions and 137 deletions

View file

@ -30,6 +30,7 @@ import "./user-preferences/auto-launch";
import "./autoupdater/check-for-updates";
import "./autoupdater/restart-and-install-update";
import "./autoupdater/continue-to-main-window";
import "./user-preferences/authenticate-real-debrid";
ipcMain.handle("ping", () => "pong");
ipcMain.handle("getVersion", () => app.getVersion());

View file

@ -0,0 +1,14 @@
import { RealDebridClient } from "@main/services/real-debrid";
import { registerEvent } from "../register-event";
const authenticateRealDebrid = async (
_event: Electron.IpcMainInvokeEvent,
apiToken: string
) => {
RealDebridClient.authorize(apiToken);
const user = await RealDebridClient.getUser();
return user;
};
registerEvent("authenticateRealDebrid", authenticateRealDebrid);