R0.2: gdpr_consent_at bei allen Registrierungspfaden befuellen (DSGVO)

Feld existierte seit der Migration-2026-Erweiterung, wurde aber nirgends
geschrieben. Jetzt gesetzt bei: Volt-Registrierung (bestaetigte AGB-/
Datenschutz-Checkbox), Magic-Link-Provisioning und Google-OAuth (beide
via CustomerAccountProvisioner, Konto-Anlage nutzerinitiiert).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-03 07:53:41 +00:00
parent 1a612e04b2
commit a4184af4fb
5 changed files with 11 additions and 0 deletions

View file

@ -30,6 +30,9 @@ class CustomerAccountProvisioner
'email' => $email,
'registration_type' => RegistrationType::Company->value,
'is_active' => true,
// Konto-Anlage ist hier immer nutzerinitiiert (Magic-Link-Anforderung
// bzw. OAuth-Login) – der Zeitpunkt gilt als DSGVO-Einwilligung.
'gdpr_consent_at' => now(),
...$extraAttributes,
]);

View file

@ -33,7 +33,10 @@ new #[Layout('components.layouts.auth.pressekonto', ['heading' => 'Konto erstell
'terms_accepted.accepted' => 'Bitte bestätigen Sie unsere AGB und die Datenschutzerklärung.',
]);
// Die bestätigte AGB-/Datenschutz-Checkbox wird als DSGVO-Einwilligung
// mit Zeitstempel festgehalten (users.gdpr_consent_at).
unset($validated['terms_accepted']);
$validated['gdpr_consent_at'] = now();
$validated['password'] = Hash::make($validated['password']);
// Konto bleibt bis zur E-Mail-Verifizierung inaktiv und rollenlos

View file

@ -51,6 +51,7 @@ test('requesting access for a known contact lazily creates a scoped account and
expect($user->canAccessAdmin())->toBeFalse();
expect($user->canAccessCustomer())->toBeTrue();
expect($user->accessibleCompanyIds())->toContain($company->id);
expect($user->gdpr_consent_at)->not->toBeNull();
Mail::assertSent(MagicLoginLink::class, fn (MagicLoginLink $mail) => $mail->user->is($user));
});

View file

@ -39,6 +39,7 @@ test('a new google user is created active, verified and as customer', function (
expect($user->hasRole('customer'))->toBeTrue();
expect($user->oauth_provider)->toBe('google');
expect($user->oauth_provider_id)->toBe('g-new-1');
expect($user->gdpr_consent_at)->not->toBeNull();
$this->assertAuthenticatedAs($user);
});

View file

@ -36,6 +36,9 @@ test('new users register inactive and are sent to the verification notice', func
expect($user->hasVerifiedEmail())->toBeFalse();
expect($user->roles()->count())->toBe(0);
// Die bestätigte AGB-/Datenschutz-Checkbox wird als Einwilligung festgehalten.
expect($user->gdpr_consent_at)->not->toBeNull();
Notification::assertSentTo($user, VerifyEmail::class);
});