import axios from "axios";
import type { User } from "~/classes/User";

export function login(user: User, onSuccess: (token: string) => void)
{
    axios.post<string>(useRuntimeConfig().public.apiBase + '/login', user)
    .then((response) => {
        onSuccess(response.data);
    })
    .catch();
}