mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-08-21 01:47:33 +02:00
fix invalidate all sessions
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -1867,11 +1867,25 @@ export class API {
|
||||
* @returns
|
||||
*/
|
||||
invalidateSessions: async (userID = '') => {
|
||||
let data = null;
|
||||
if (userID) {
|
||||
data = { userID };
|
||||
return await postJSON(this.getPath(`/user/sessions/invalidate`), { userID });
|
||||
}
|
||||
return await postJSON(this.getPath(`/user/sessions/invalidate`), data);
|
||||
const res = await fetch(this.getPath(`/user/sessions/invalidate`), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
let body = {};
|
||||
try {
|
||||
body = await res.json();
|
||||
} catch (e) {
|
||||
body = {
|
||||
success: false,
|
||||
error: 'invalid JSON in response'
|
||||
};
|
||||
}
|
||||
return newResponse(body.success, res.status, body.error, body.data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user