2022-05-27 09:39:24 +00:00
|
|
|
import { AuthDemuxBase } from 'utils/auth/types';
|
|
|
|
import { Creds } from 'utils/types';
|
2022-04-18 11:29:20 +00:00
|
|
|
|
|
|
|
export class AuthDemux extends AuthDemuxBase {
|
2023-06-22 08:52:54 +00:00
|
|
|
#isElectron = false;
|
2022-04-18 11:29:20 +00:00
|
|
|
constructor(isElectron: boolean) {
|
|
|
|
super();
|
|
|
|
this.#isElectron = isElectron;
|
|
|
|
}
|
|
|
|
|
2022-05-27 09:39:24 +00:00
|
|
|
async getCreds(): Promise<Creds> {
|
2022-04-18 11:29:20 +00:00
|
|
|
if (this.#isElectron) {
|
2023-07-10 09:12:20 +00:00
|
|
|
return await ipc.getCreds();
|
2022-04-18 11:29:20 +00:00
|
|
|
} else {
|
2022-05-27 09:39:24 +00:00
|
|
|
return { errorLogUrl: '', tokenString: '', telemetryUrl: '' };
|
2022-04-18 11:29:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|