@archon-inc/sdk
Version:
Integrate easily to our government platform using this SDK. More info on https://archon.inc/sdk
16 lines (15 loc) • 612 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = endSession;
const Archon_js_1 = require("../Archon.js");
/**
* End the session of the user. You should redirect the user away from protected resources after calling this function.
* @param session The session to end.
*/
async function endSession(session) {
const request = await Archon_js_1.Archon.request(`/users/session/${typeof session === "number" ? session : session.id}`, "DELETE");
if (request.status !== 200) {
throw new Error(`Failed to end session: ${request.data}`);
}
return;
}