Skip to content

Commit

Permalink
added user session tracking, social accoutn tracking, and implemented…
Browse files Browse the repository at this point in the history
… local user logon blocking
  • Loading branch information
sadnub committed Sep 28, 2024
1 parent 05c1ef2 commit 8c56cf5
Show file tree
Hide file tree
Showing 15 changed files with 684 additions and 150 deletions.
28 changes: 28 additions & 0 deletions src/api/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,34 @@ export async function resetTwoFactor() {
}
}

// sessions api
export async function fetchUserSessions(id) {
try {
const { data } = await axios.get(`${baseUrl}/users/${id}/sessions/`);
return data;
} catch (e) {
console.error(e);
}
}

export async function deleteAllUserSessions(id) {
try {
const { data } = await axios.delete(`${baseUrl}/users/${id}/sessions/`);
return data;
} catch (e) {
console.error(e);
}
}

export async function deleteUserSession(id) {
try {
const { data } = await axios.delete(`${baseUrl}/sessions/${id}/`);
return data;
} catch (e) {
console.error(e);
}
}

// role api function
export async function fetchRoles(params = {}) {
try {
Expand Down
7 changes: 7 additions & 0 deletions src/api/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ import type {
TestRunURLActionResponse,
} from "@/types/core/urlactions";

import type { CoreSetting } from "@/types/core/settings";

const baseUrl = "/core";

export async function fetchCoreSettings(params = {}): Promise<CoreSetting> {
const { data } = await axios.get("/core/settings/", { params: params });
return data;
}

export async function fetchDashboardInfo(params = {}) {
const { data } = await axios.get(`${baseUrl}/dashinfo/`, { params: params });
return data;
Expand Down
Loading

0 comments on commit 8c56cf5

Please sign in to comment.