Added auth to endpoints
This commit is contained in:
13
ui/src/api/auth.ts
Normal file
13
ui/src/api/auth.ts
Normal 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 });
|
||||
}
|
||||
Reference in New Issue
Block a user