MCPcopy Create free account
hub / github.com/MemTensor/MemOS / handleLogout

Method handleLogout

packages/memos-core/src/viewer/server.ts:477–487  ·  view source on GitHub ↗
(req: http.IncomingMessage, res: http.ServerResponse)

Source from the content-addressed store, hash-verified

475 }
476
477 private handleLogout(req: http.IncomingMessage, res: http.ServerResponse): void {
478 const cookie = req.headers.cookie ?? "";
479 const re = new RegExp(`${this.cookieName}=([a-f0-9]+)`);
480 const match = cookie.match(re);
481 if (match) this.auth.sessions.delete(match[1]);
482 res.writeHead(200, {
483 "Content-Type": "application/json",
484 "Set-Cookie": `${this.cookieName}=; Path=/; HttpOnly; Max-Age=0`,
485 });
486 res.end(JSON.stringify({ ok: true }));
487 }
488
489 private handlePasswordReset(req: http.IncomingMessage, res: http.ServerResponse): void {
490 this.readBody(req, (body) => {

Callers 1

handleRequestMethod · 0.95

Calls 3

matchMethod · 0.80
endMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected