mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 08:43:57 +00:00
feat: own tab to torbox
This commit is contained in:
@@ -46,6 +46,7 @@ import "./user-preferences/auto-launch";
|
||||
import "./autoupdater/check-for-updates";
|
||||
import "./autoupdater/restart-and-install-update";
|
||||
import "./user-preferences/authenticate-real-debrid";
|
||||
import "./user-preferences/authenticate-torbox";
|
||||
import "./download-sources/put-download-source";
|
||||
import "./auth/sign-out";
|
||||
import "./auth/open-auth-window";
|
||||
|
||||
14
src/main/events/user-preferences/authenticate-torbox.ts
Normal file
14
src/main/events/user-preferences/authenticate-torbox.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { registerEvent } from "../register-event";
|
||||
import { TorBoxClient } from "@main/services/download/torbox";
|
||||
|
||||
const authenticateTorBox = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
apiToken: string
|
||||
) => {
|
||||
TorBoxClient.authorize(apiToken);
|
||||
|
||||
const user = await TorBoxClient.getUser();
|
||||
return user;
|
||||
};
|
||||
|
||||
registerEvent("authenticateTorBox", authenticateTorBox);
|
||||
Reference in New Issue
Block a user