Added auth to endpoints

This commit is contained in:
Benjamin Sherriff
2023-10-18 15:36:36 -04:00
parent 7ba0e070ac
commit f072a47d22
12 changed files with 160 additions and 84 deletions

13
ui/src/api/auth.ts Normal file
View File

@@ -0,0 +1,13 @@
import { getRequest, postRequest } from '.';
export async function login(email: string, password: string) {
return await postRequest('auth/login', { email, password }, { withCredentials: true });
}
export async function logout() {
return await postRequest('auth/logout', {}, { withCredentials: true });
}
export async function me() {
return await getRequest('auth/me', { withCredentials: true });
}