From 7c7c4fcb6fa924560d5bbee019d78ae032f6c5db Mon Sep 17 00:00:00 2001 From: Bastian Masanek Date: Fri, 31 Oct 2025 14:27:38 +0100 Subject: [PATCH] Implement direct login functionality with email and password - Update login API to support direct authentication via email and password, removing the OAuth2 redirect flow. - Modify LoginForm component to include password field and validation. - Refactor useAuth composable to handle login with both email and password. - Remove unnecessary OAuth2 callback handler and PKCE utilities. - Update relevant documentation and error handling for the new login method. --- .claude/settings.local.json | 5 +- app/components/Auth/LoginForm.vue | 16 +++- app/composables/useAuth.ts | 23 ++++-- app/pages/auth.vue | 4 + server/api/auth/callback.get.ts | 128 ------------------------------ server/api/auth/login.post.ts | 112 +++++++++++++++++--------- server/utils/cidaas.ts | 68 ++++++++++++++++ server/utils/pkce.ts | 90 --------------------- 8 files changed, 178 insertions(+), 268 deletions(-) delete mode 100644 server/api/auth/callback.get.ts delete mode 100644 server/utils/pkce.ts diff --git a/.claude/settings.local.json b/.claude/settings.local.json index f1269af..c5119df 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -46,7 +46,10 @@ "mcp__context7__get-library-docs", "mcp__playwright__browser_click", "mcp__playwright__browser_type", - "WebFetch(domain:www.shadcn-vue.com)" + "WebFetch(domain:www.shadcn-vue.com)", + "WebFetch(domain:docs.cidaas.com)", + "WebFetch(domain:articles.cidaas.de)", + "WebFetch(domain:pre-release-docs.cidaas.com)" ], "deny": [], "ask": [] diff --git a/app/components/Auth/LoginForm.vue b/app/components/Auth/LoginForm.vue index 1f77cf2..1fe7e84 100644 --- a/app/components/Auth/LoginForm.vue +++ b/app/components/Auth/LoginForm.vue @@ -11,6 +11,7 @@ const { login } = useAuth() const loginSchema = toTypedSchema( z.object({ email: z.string().email('Bitte geben Sie eine gültige E-Mail-Adresse ein'), + password: z.string().min(8, 'Passwort muss mindestens 8 Zeichen lang sein'), }) ) @@ -27,7 +28,7 @@ const onSubmit = handleSubmit(async (values) => { submitError.value = null try { - await login(values.email) + await login(values.email, values.password) // Redirect happens in login() function } catch (error: any) { console.error('Login error:', error) @@ -55,6 +56,17 @@ const onSubmit = handleSubmit(async (values) => { + + + + Passwort + + + + + + +