Files
harheimertc/server/api/auth/passkeys/list.get.js
Torsten Schulz (local) 0528334eb4
All checks were successful
Code Analysis and Production Deploy / analyze (push) Successful in 5m10s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m14s
feat: replace success modal with non-blocking toast notification
feat: add global event listener for mannschaften updates in Navigation component

feat: notify app of mannschaften changes after CSV save and handle visibility changes

refactor: remove unused anlagen page

fix: update CmsMannschaften reference in sportbetrieb page for reactivity

fix: enhance authentication token retrieval in passkey API endpoints

feat: implement refresh session and access token generation for Android clients in passkey login

fix: unify token retrieval method across passkey API endpoints

feat: add MediaTypes utility for JSON content type in Android app

feat: create PasskeyRepository for handling passkey authentication and registration in Android app

feat: add validated text field and rich text components for Android UI

feat: implement newsletter subscription and unsubscription screens in Android app

feat: create public pages including Impressum with dynamic content loading
2026-05-28 08:33:28 +02:00

27 lines
785 B
JavaScript

import { getUserFromToken } from '../../../utils/auth.js'
export default defineEventHandler(async (event) => {
const token = getCookie(event, 'auth_token') || getHeader(event, 'authorization')?.replace(/^Bearer\s+/i, '')
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
}))
}
})