import { useAuthStore } from "../../../stores/auth-store";

export const useAuthApi = () => {
    const authStore = useAuthStore();
    

    
    const login = () => {
        authStore.login();
    };

    const oidcLogin = () => {
        authStore.oidcLogin();
    };

    const logout = () => {
        authStore.logout();
    };

    const isAuthorizedUser = () => {
        return authStore.isAuthorizedUser;
    };

    const setUser = (bypassRole: string) => {
        authStore.setUser(bypassRole);
    }

    return {
        login,
        oidcLogin,
        logout,
        isAuthorizedUser,
        setUser,
    };
};