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

Method saveAuth

packages/memos-core/src/viewer/server.ts:252–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

250 }
251
252 private saveAuth(): void {
253 try {
254 fs.mkdirSync(path.dirname(this.authFile), { recursive: true });
255 fs.writeFileSync(this.authFile, JSON.stringify({ passwordHash: this.auth.passwordHash }));
256 } catch (e) {
257 this.log.warn(`Failed to save viewer auth: ${e}`);
258 }
259 }
260
261 private hashPassword(pw: string): string {
262 return crypto.createHash("sha256").update(pw + "memos-lite-salt-2026").digest("hex");

Callers 2

handleSetupMethod · 0.95
handlePasswordResetMethod · 0.95

Calls 1

warnMethod · 0.65

Tested by

no test coverage detected