260218:1712 20260218 TASK-BEFE-001n
All checks were successful
Build and Deploy / deploy (push) Successful in 4m55s
All checks were successful
Build and Deploy / deploy (push) Successful in 4m55s
This commit is contained in:
27
frontend/lib/services/session.service.ts
Normal file
27
frontend/lib/services/session.service.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import apiClient from '@/lib/api/client';
|
||||
|
||||
export interface Session {
|
||||
id: string; // tokenId
|
||||
userId: number;
|
||||
user: {
|
||||
username: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
};
|
||||
deviceName: string;
|
||||
ipAddress: string;
|
||||
lastActive: string;
|
||||
isCurrent: boolean;
|
||||
}
|
||||
|
||||
export const sessionService = {
|
||||
getActiveSessions: async () => {
|
||||
const response = await apiClient.get<any>('/auth/sessions');
|
||||
return response.data.data || response.data;
|
||||
},
|
||||
|
||||
revokeSession: async (sessionId: number) => {
|
||||
const response = await apiClient.delete(`/auth/sessions/${sessionId}`);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user