feat(auth): migrate frontend from username to email-only authentication
- Login page: email input replaces username field (type=email, name=email) - Login server action: reads email, uses i18n error for missing credentials - AccountSection: email input (type=email) replaces username text field - New user server action: sends email as required field, drops username - UsersListPanel: displays and searches by email instead of username - Admin edit user page: heading and delete confirm use email - Profile page: fullName fallback uses email, drops @username display - app.d.ts: email required on User, username removed - Generated API types: AppUser.email required, username removed; CreateUserRequest.email required, username removed - i18n: login_label_email, login_error_missing_credentials, admin_col_login updated (de/en/es) - errors.ts: MISSING_CREDENTIALS → login_error_missing_credentials Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,10 +21,10 @@ describe('Login page – rendering', () => {
|
||||
await expect.element(page.getByRole('button', { name: 'Anmelden' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the username input', async () => {
|
||||
it('renders the email input', async () => {
|
||||
render(LoginPage, {});
|
||||
await tick();
|
||||
const input = document.querySelector<HTMLInputElement>('input[name="username"]');
|
||||
const input = document.querySelector<HTMLInputElement>('input[name="email"]');
|
||||
expect(input).not.toBeNull();
|
||||
});
|
||||
|
||||
@@ -35,10 +35,10 @@ describe('Login page – rendering', () => {
|
||||
expect(input).not.toBeNull();
|
||||
});
|
||||
|
||||
it('username field is required', async () => {
|
||||
it('email field is required', async () => {
|
||||
render(LoginPage, {});
|
||||
await tick();
|
||||
const input = document.querySelector<HTMLInputElement>('input[name="username"]');
|
||||
const input = document.querySelector<HTMLInputElement>('input[name="email"]');
|
||||
expect(input?.required).toBe(true);
|
||||
});
|
||||
|
||||
@@ -49,6 +49,13 @@ describe('Login page – rendering', () => {
|
||||
expect(input?.required).toBe(true);
|
||||
});
|
||||
|
||||
it('email field has type="email"', async () => {
|
||||
render(LoginPage, {});
|
||||
await tick();
|
||||
const input = document.querySelector<HTMLInputElement>('input[name="email"]');
|
||||
expect(input?.type).toBe('email');
|
||||
});
|
||||
|
||||
it('password field has type="password"', async () => {
|
||||
render(LoginPage, {});
|
||||
await tick();
|
||||
|
||||
Reference in New Issue
Block a user