Files
loyaly-merchant/src/features/settings/repositories/securityRepository.ts
2026-09-19 13:12:19 +05:30

17 lines
589 B
TypeScript

import {deleteJson, postJson, type Endpoint} from '@/shared/services/httpClient';
import type {DeviceSession} from '@/features/settings/services/mapSession';
/** Signed-in devices, and the two ways to end them. */
export const securityRepository = {
sessions: (): Endpoint<DeviceSession[]> => ({
path: '/api/auth/sessions',
params: {},
}),
revoke: (id: string) =>
deleteJson<null>(`/api/auth/sessions/${encodeURIComponent(id)}`),
/** Keeps this browser signed in — see the route. */
revokeOthers: () => postJson<null>('/api/auth/sessions/revoke-others', {}),
};