18 lines
473 B
TypeScript
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: {},
|
|
});
|
|
}
|
|
|