Implement frontend auth and user features - WIP

This commit is contained in:
Philipinho
2023-08-27 21:38:59 +01:00
parent 3e7c2de9a4
commit 54a748ced7
30 changed files with 765 additions and 6 deletions
@@ -0,0 +1,12 @@
import api from "@/lib/api-client";
import { ILogin, IRegister, ITokenResponse, ITokens } from "@/features/auth/types/auth.types";
export async function login(data: ILogin): Promise<ITokenResponse>{
const req = await api.post<ITokens>("/auth/login", data);
return req.data as ITokenResponse;
}
export async function register(data: IRegister): Promise<ITokenResponse>{
const req = await api.post<ITokens>("/auth/register", data);
return req.data as ITokenResponse;
}