import { FEAGlobals } from "../../common/Globals";
export const useAuth = () => {
    const publishAuthorization = (user, credentials) => {
        FEAGlobals.FSBL.System.Window.getCurrent().hide();
        FEAGlobals.FSBL.Clients.AuthenticationClient.publishAuthorization(user, credentials);
    };
    const quitApplication = () => {
        FEAGlobals.FSBL.System.exit();
    };
    return {
        publishAuthorization,
        quitApplication,
    };
};
export const useAuthSimulator = () => {
    const sendToServer = async (username, password) => {
        if (!username || !username.length)
            return await Promise.resolve({ error: "Missing or empty username" });
        if (!password || !password.length)
            return await Promise.resolve({ error: "Missing or empty password" });
        return await Promise.resolve({ result: "ok" });
    };
    return {
        sendToServer,
    };
};
//# sourceMappingURL=useAuth.js.map