Add missing getUserById and getUserByEmail exports to auth utils
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user