From c43baa54d8ed48c1fb8ea6caa3cbdbd3adc58a0f Mon Sep 17 00:00:00 2001 From: G Date: Tue, 7 May 2024 11:32:10 +0000 Subject: [PATCH] function to hit the django authentication api --- src/utils/requests/authenticateUser.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/utils/requests/authenticateUser.ts diff --git a/src/utils/requests/authenticateUser.ts b/src/utils/requests/authenticateUser.ts new file mode 100644 index 0000000..868c9d0 --- /dev/null +++ b/src/utils/requests/authenticateUser.ts @@ -0,0 +1,16 @@ +import { IauthenticationData } from "@/contexts/Types"; +import axiosRequest from "../axios-request"; + +const authenticateUser = async ({ username, password }: { username: string; password: string }) => { + return await axiosRequest({ + url: "/api/token/", + method: "POST", + data: { + username: username, + password: password, + }, + }); +}; + + +export default authenticateUser; \ No newline at end of file -- libgit2 0.27.1