feat: add user authentication flow and configuration management

This commit is contained in:
2025-07-02 11:59:22 +02:00
parent ccb755603e
commit c97cfabfa4
7 changed files with 145 additions and 26 deletions

View File

@@ -4,12 +4,14 @@ import { invoke } from '@tauri-apps/api/core';
import { Crypto } from './crypto';
export class Config {
private fileName: string;
private config: Record<string, unknown> = {};
private crypto: Crypto | undefined;
private configFilePath: string | undefined;
private encrypt: boolean;
constructor(encrypt?: boolean) {
constructor(fileName: string, encrypt?: boolean) {
this.fileName = fileName;
this.encrypt = encrypt ?? false;
}
@@ -20,7 +22,7 @@ export class Config {
const homeDir = await path.homeDir();
const folderPath = await path.join(homeDir, '.ezpplauncher');
this.configFilePath = await path.join(folderPath, 'user_settings');
this.configFilePath = await path.join(folderPath, this.fileName);
const createFolder = !(await exists(folderPath));
if (createFolder) await mkdir(folderPath);