mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 21:03:47 +00:00
v2.2.1 (#754)
* fix: rdp, desktop app, and mobile app login issues and guacd issues * fix: general fixes * fix: mobile/desktop login isssues * fix: mobile/desktop login isssues * fix: mobile/desktop login isssues * chore: format
This commit is contained in:
@@ -383,6 +383,14 @@ function createApiInstance(
|
||||
} else {
|
||||
config.headers["X-Electron-App"] = "true";
|
||||
}
|
||||
const jwt = localStorage.getItem("jwt");
|
||||
if (jwt) {
|
||||
if (config.headers.set) {
|
||||
config.headers.set("Authorization", `Bearer ${jwt}`);
|
||||
} else {
|
||||
config.headers["Authorization"] = `Bearer ${jwt}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -2944,6 +2952,15 @@ export async function getUserInfo(): Promise<UserInfo> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function getCurrentToken(): Promise<string | null> {
|
||||
try {
|
||||
const response = await authApi.get("/users/me/token");
|
||||
return response.data?.token ?? null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export async function unlockUserData(
|
||||
password: string,
|
||||
): Promise<{ success: boolean; message: string }> {
|
||||
|
||||
Reference in New Issue
Block a user