chore: build
This commit is contained in:
+10
-3
@@ -1,4 +1,5 @@
|
||||
import apiClient from "./client";
|
||||
import { API_BASE_URL } from "./client";
|
||||
import type {
|
||||
ConfirmReceptionResponse,
|
||||
CheckoutCartResponse,
|
||||
@@ -12,7 +13,7 @@ import type {
|
||||
import { getToken } from "../auth/tokenStorage";
|
||||
import { extractUsernameFromToken } from "../auth/jwtUtils";
|
||||
|
||||
const V1 = "https://mln-uber.club/api/v1";
|
||||
const V1 = `${API_BASE_URL}/api/v1`;
|
||||
|
||||
export const getJwtUsername = async (): Promise<string | null> => {
|
||||
const token = await getToken();
|
||||
@@ -901,7 +902,11 @@ export const get2FAStatus = async (): Promise<{
|
||||
const { data } = await apiClient.get(`${V1}/two-fa/status`);
|
||||
return data;
|
||||
} catch {
|
||||
return { two_fa_enabled: false, telegram_linked: false, admin_2fa_enabled: false };
|
||||
return {
|
||||
two_fa_enabled: false,
|
||||
telegram_linked: false,
|
||||
admin_2fa_enabled: false,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -909,7 +914,9 @@ export const toggle2FA = async (
|
||||
enabled: boolean,
|
||||
): Promise<{ success: boolean; error?: string }> => {
|
||||
try {
|
||||
const { data } = await apiClient.post(`${V1}/two-fa/toggle`, { enabled });
|
||||
const { data } = await apiClient.post(`${V1}/two-fa/toggle`, {
|
||||
enabled,
|
||||
});
|
||||
return { success: data.success ?? true };
|
||||
} catch (e: any) {
|
||||
return { success: false, error: e?.response?.data?.error || "Erreur" };
|
||||
|
||||
Reference in New Issue
Block a user