Adapt to existing beos table in database sternwarte

Column mapping: id, name/vorname, kürzel (with umlaut), pw instead of
the planned schema. DB_NAME changed to sternwarte. create_table.sql
no longer creates beos, only the three new logbuch tables.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 17:34:45 +02:00
parent 4e53a7a5cd
commit 12be2f1db2
5 changed files with 25 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
'use server';
import { redirect } from 'next/navigation';
import { verifyCredentials } from '@/lib/auth';
import { verifyCredentials, getBeoDisplayName } from '@/lib/auth';
import { createSession } from '@/lib/session';
export async function login(
@@ -22,14 +22,14 @@ export async function login(
}
await createSession({
kuerzel: result.beo.Kuerzel,
beoId: result.beo.ID,
beoName: result.beo.Name,
kuerzel: result.beo.kürzel ?? kuerzel,
beoId: result.beo.id,
beoName: getBeoDisplayName(result.beo),
mustChangePassword: result.beo.MustChangePassword === 1,
isAuthenticated: true,
});
if (result.beo.MustChangePassword === 1) {
if (result.beo.MustChangePassword === 1 || !result.beo.pw) {
redirect('/change-password');
}