From be0f537dc4fe384eef09436833c6407e6482c16d Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 9 Nov 2023 15:40:16 +0700 Subject: Initial commit --- src/common/libs/authenticate.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/common/libs/authenticate.ts (limited to 'src/common/libs/authenticate.ts') diff --git a/src/common/libs/authenticate.ts b/src/common/libs/authenticate.ts new file mode 100644 index 0000000..48d0314 --- /dev/null +++ b/src/common/libs/authenticate.ts @@ -0,0 +1,22 @@ +const authenticate = async ({ + username, + password, +}: { + username: string; + password: string; +}) => { + const res = await fetch("/api/authenticate", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + username, + password, + }), + }); + + return res; +}; + +export default authenticate; -- cgit v1.2.3