Update Apache SSL configuration and enhance security features across multiple files. Changed X-Frame-Options to SAMEORIGIN for better security, added optional Content Security Policy headers for testing, and improved password handling with HaveIBeenPwned checks during user registration and password reset. Implemented passkey login functionality in the authentication flow, including UI updates for user experience. Enhanced image upload processing with size limits and validation, and added rate limiting for various API endpoints to prevent abuse.
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 51s
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 51s
This commit is contained in:
27
server/api/auth/passkeys/list.get.js
Normal file
27
server/api/auth/passkeys/list.get.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { getUserFromToken } from '../../../utils/auth.js'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const token = getCookie(event, 'auth_token')
|
||||
const user = token ? await getUserFromToken(token) : null
|
||||
|
||||
if (!user) {
|
||||
throw createError({ statusCode: 401, statusMessage: 'Nicht authentifiziert' })
|
||||
}
|
||||
|
||||
const passkeys = Array.isArray(user.passkeys) ? user.passkeys : []
|
||||
|
||||
return {
|
||||
success: true,
|
||||
passkeys: passkeys.map(pk => ({
|
||||
id: pk.id,
|
||||
name: pk.name || 'Passkey',
|
||||
credentialId: pk.credentialId,
|
||||
createdAt: pk.createdAt || null,
|
||||
lastUsedAt: pk.lastUsedAt || null,
|
||||
deviceType: pk.deviceType || null,
|
||||
backedUp: pk.backedUp ?? null
|
||||
}))
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user