feat: welcome desk auth and operator password reset
CI / Test (push) Canceled after 0s
CI / Build and push (push) Canceled after 0s

First visit lands on /welcome instead of burying signup in Settings.
Add a host CLI to reset passwords without a session, plus Settings
change-password. Refresh as-built design docs and the Unraid operator guide.
This commit is contained in:
Investor Flow Build
2026-08-19 21:19:57 -04:00
parent 90e1829d39
commit 7649eaf399
23 changed files with 1692 additions and 658 deletions
+10
View File
@@ -129,6 +129,16 @@ const authRouter = router({
ctx.resHeaders.append('Set-Cookie', clearCookie());
return { ok: true };
}),
changePassword: protectedProcedure
.input(z.object({ current: z.string(), next: z.string().min(8) }))
.mutation(({ ctx, input }) => {
const row = ctx.db.prepare('SELECT pw_hash FROM users WHERE id=?').get(ctx.userId) as { pw_hash: string } | undefined;
if (!row || row.pw_hash === 'oauth' || !verifyPassword(input.current, row.pw_hash)) {
throw new TRPCError({ code: 'UNAUTHORIZED', message: 'Current password is wrong.' });
}
ctx.db.prepare('UPDATE users SET pw_hash=? WHERE id=?').run(hashPassword(input.next), ctx.userId);
return { ok: true };
}),
me: publicProcedure.query(({ ctx }) => {
if (!ctx.userId) return null;
const u = ctx.db.prepare(