mirror of
https://github.com/Tony0410/quietthanks.git
synced 2026-05-24 21:31:41 +08:00
Add multiple entries per day, user management, reminders, and AI reflections
- Multiple entries per day: Home page now starts fresh, Save & New button - Admin user management: Add/delete users, reset passwords, toggle admin - Daily reminders: Browser notifications at configurable time - AI reflections: Generate insights from entries using Claude API - Remove cloud sync placeholder (already have user accounts) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ export interface AuthUser {
|
||||
id: string;
|
||||
email: string;
|
||||
name: string | null;
|
||||
isAdmin: boolean;
|
||||
}
|
||||
|
||||
export async function hashPassword(password: string): Promise<string> {
|
||||
@@ -68,6 +69,7 @@ export async function getSession(): Promise<AuthUser | null> {
|
||||
userId: schema.users.id,
|
||||
email: schema.users.email,
|
||||
name: schema.users.name,
|
||||
isAdmin: schema.users.isAdmin,
|
||||
expiresAt: schema.sessions.expiresAt,
|
||||
})
|
||||
.from(schema.sessions)
|
||||
@@ -83,6 +85,7 @@ export async function getSession(): Promise<AuthUser | null> {
|
||||
id: result[0].userId,
|
||||
email: result[0].email,
|
||||
name: result[0].name,
|
||||
isAdmin: result[0].isAdmin === 1,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -122,6 +125,7 @@ export async function registerUser(
|
||||
id: userId,
|
||||
email: email.toLowerCase(),
|
||||
name: name || null,
|
||||
isAdmin: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -154,6 +158,7 @@ export async function loginUser(
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
isAdmin: user.isAdmin === 1,
|
||||
},
|
||||
sessionId,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user