mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: refactor deeplnik handler
This commit is contained in:
parent
1bf2c8faf9
commit
16c4460011
5 changed files with 6 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
import { userAuthRepository } from "@main/repository";
|
||||
import axios, { AxiosError, AxiosInstance } from "axios";
|
||||
import { WindowManager } from "./window-manager";
|
||||
import url from "url";
|
||||
|
||||
export class HydraApi {
|
||||
private static instance: AxiosInstance;
|
||||
|
@ -18,7 +19,9 @@ export class HydraApi {
|
|||
}
|
||||
|
||||
static async handleExternalAuth(auth: string) {
|
||||
const decodedBase64 = atob(auth);
|
||||
const { payload } = url.parse(auth, true).query;
|
||||
|
||||
const decodedBase64 = atob(payload as string);
|
||||
const jsonData = JSON.parse(decodedBase64);
|
||||
|
||||
const { accessToken, expiresIn, refreshToken } = jsonData;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue