updates
This commit is contained in:
31
Frontend/src/features/auth/services/sessionService.ts
Normal file
31
Frontend/src/features/auth/services/sessionService.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import apiClient from '../../../shared/services/apiClient';
|
||||
|
||||
export interface UserSession {
|
||||
id: number;
|
||||
ip_address?: string;
|
||||
user_agent?: string;
|
||||
device_info?: string;
|
||||
last_activity: string;
|
||||
created_at: string;
|
||||
expires_at: string;
|
||||
}
|
||||
|
||||
class SessionService {
|
||||
async getMySessions() {
|
||||
const response = await apiClient.get('/sessions');
|
||||
return response.data;
|
||||
}
|
||||
|
||||
async revokeSession(sessionId: number) {
|
||||
const response = await apiClient.delete(`/sessions/${sessionId}`);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
async revokeAllSessions() {
|
||||
const response = await apiClient.post('/sessions/revoke-all');
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
export default new SessionService();
|
||||
|
||||
Reference in New Issue
Block a user