diff --git a/packages/frontend-core/src/api/auth.ts b/packages/frontend-core/src/api/auth.ts index aa55c32a51..7d429c0c82 100644 --- a/packages/frontend-core/src/api/auth.ts +++ b/packages/frontend-core/src/api/auth.ts @@ -1,17 +1,23 @@ import { GetInitInfoResponse, LoginRequest, + LoginResponse, LogoutResponse, PasswordResetRequest, PasswordResetResponse, PasswordResetUpdateRequest, PasswordResetUpdateResponse, SetInitInfoRequest, + SetInitInfoResponse, } from "@budibase/types" import { BaseAPIClient } from "./types" export interface AuthEndpoints { - logIn: (tenantId: string, username: string, password: string) => Promise + logIn: ( + tenantId: string, + username: string, + password: string + ) => Promise logOut: () => Promise requestForgotPassword: ( tenantId: string, @@ -22,7 +28,7 @@ export interface AuthEndpoints { password: string, resetCode: string ) => Promise - setInitInfo: (info: SetInitInfoRequest) => Promise + setInitInfo: (info: SetInitInfoRequest) => Promise getInitInfo: () => Promise } @@ -34,13 +40,12 @@ export const buildAuthEndpoints = (API: BaseAPIClient): AuthEndpoints => ({ * @param password the password */ logIn: async (tenantId, username, password) => { - return await API.post({ + return await API.post({ url: `/api/global/auth/${tenantId}/login`, body: { username, password, }, - parseResponse: () => undefined, }) },