()
| 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"); |
no test coverage detected