Refactored slightly

This commit is contained in:
2026-04-04 16:45:31 +02:00
parent 85ee25aa76
commit db0b229e52
9 changed files with 67 additions and 22 deletions
+50
View File
@@ -0,0 +1,50 @@
import { invoke } from "@tauri-apps/api/core";
/**
* Create Microsoft login URL
*/
export async function authCreateLink(): Promise<string> {
return await invoke("auth_create_link");
}
/**
* Exchange auth code for account
*/
export async function authLogin(code: string) {
return await invoke("auth_login", { code });
}
/**
* Refresh account by UUID
*/
export async function authRefresh(uuid: string) {
return await invoke("auth_refresh", { uuid });
}
/**
* Get all stored accounts
*/
export async function authList() {
return await invoke("auth_list");
}
/**
* Remove account by UUID
*/
export async function authRemove(uuid: string) {
return await invoke("auth_remove", { uuid });
}
/**
* Validate token (not expired)
*/
export async function authValidate(uuid: string): Promise<boolean> {
return await invoke("auth_validate", { uuid });
}
/**
* Get valid account (auto-refresh if needed)
*/
export async function authGetValid(uuid: string) {
return await invoke("auth_get_valid", { uuid });
}