Add missing getUserById and getUserByEmail exports to auth utils

This commit is contained in:
Torsten Schulz (local)
2025-10-21 14:30:56 +02:00
parent 32ba9e2760
commit fa54e53820
130 changed files with 34 additions and 14480 deletions

View File

@@ -98,6 +98,18 @@ export function verifyToken(token) {
}
}
// Get user by ID
export async function getUserById(id) {
const users = await readUsers()
return users.find(u => u.id === id)
}
// Get user by email
export async function getUserByEmail(email) {
const users = await readUsers()
return users.find(u => u.email === email)
}
// Get user from token
export async function getUserFromToken(token) {
const decoded = verifyToken(token)