diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-11-09 15:40:16 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-11-09 15:40:16 +0700 |
| commit | be0f537dc4fe384eef09436833c6407e6482c16d (patch) | |
| tree | 194b1ad3f34396cb8149075bbbd38b854aedf361 /src/common/libs/authenticate.ts | |
| parent | 5d5401ae36e7e0c8eb38ccd943c1aa44a9573d35 (diff) | |
Initial commit
Diffstat (limited to 'src/common/libs/authenticate.ts')
| -rw-r--r-- | src/common/libs/authenticate.ts | 22 |
1 files changed, 22 insertions, 0 deletions
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; |
