mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-13 05:05:41 +08:00
Implement authentication, waitlist, and logging upgrades
This commit is contained in:
15
server/api/auth/me.get.ts
Normal file
15
server/api/auth/me.get.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { requireUserSession } from '../../utils/auth'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const user = await requireUserSession(event)
|
||||
return {
|
||||
id: String(user._id),
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
role: user.role,
|
||||
createdAt: user.createdAt,
|
||||
lastLoginAt: user.lastLoginAt,
|
||||
invitationCodesIssued: user.invitationCodesIssued,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user