Uecko_ERP/modules/identity/src/web/shared/api/get-current-session.api.ts

18 lines
473 B
TypeScript

import type { IDataSource } from "@erp/core/client";
import type { CurrentSessionResponseDTO } from "@erp/identity/common";
export function getCurrentSession(
dataSource: IDataSource,
accessToken: string
): Promise<CurrentSessionResponseDTO> {
return dataSource.custom<Record<string, never>, CurrentSessionResponseDTO>({
path: "identity/auth/session",
method: "get",
headers: {
Authorization: `Bearer ${accessToken}`,
},
data: {},
});
}