mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: adding real debrid user auth
This commit is contained in:
parent
86816dc3c3
commit
183b85d66a
24 changed files with 234 additions and 137 deletions
|
|
@ -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());
|
||||
|
|
|
|||
14
src/main/events/user-preferences/authenticate-real-debrid.ts
Normal file
14
src/main/events/user-preferences/authenticate-real-debrid.ts
Normal 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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue