login issue
This commit is contained in:
16
src/features/settings/repositories/securityRepository.ts
Normal file
16
src/features/settings/repositories/securityRepository.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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', {}),
|
||||
};
|
||||
Reference in New Issue
Block a user