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:
@@ -54,6 +54,28 @@ export const useAuthStore = defineStore('auth', {
|
||||
return response
|
||||
},
|
||||
|
||||
async passkeyLogin() {
|
||||
// Client-only
|
||||
if (typeof window === 'undefined' || !window.PublicKeyCredential) {
|
||||
throw new Error('Passkeys werden von diesem Browser nicht unterstützt.')
|
||||
}
|
||||
|
||||
const { options } = await $fetch('/api/auth/passkeys/authentication-options', { method: 'POST' })
|
||||
const mod = await import('@simplewebauthn/browser')
|
||||
const credential = await mod.startAuthentication(options)
|
||||
|
||||
const response = await $fetch('/api/auth/passkeys/login', {
|
||||
method: 'POST',
|
||||
body: { credential }
|
||||
})
|
||||
|
||||
if (response.success) {
|
||||
await this.checkAuth()
|
||||
}
|
||||
|
||||
return response
|
||||
},
|
||||
|
||||
async logout() {
|
||||
try {
|
||||
await $fetch('/api/auth/logout', { method: 'POST' })
|
||||
|
||||
Reference in New Issue
Block a user