generated from boboko/starter
reverted a migration and some 3dealer functionality that should be in core
This commit is contained in:
@@ -49,9 +49,6 @@ public function send(string $locale, Request $request, UserOtpService $otp): Red
|
|||||||
|
|
||||||
$email = Str::lower(trim($validated['email']));
|
$email = Str::lower(trim($validated['email']));
|
||||||
|
|
||||||
$userModel = config('auth.providers.users.model');
|
|
||||||
$isNewAccount = ! $userModel::where('email', $email)->exists();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$otp->generateAndSend($email);
|
$otp->generateAndSend($email);
|
||||||
} catch (OtpThrottledException) {
|
} catch (OtpThrottledException) {
|
||||||
@@ -60,16 +57,6 @@ public function send(string $locale, Request $request, UserOtpService $otp): Red
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// generateAndSend() just created the account: record that it happened
|
|
||||||
// under the login page's terms notice, and which versions it showed.
|
|
||||||
if ($isNewAccount) {
|
|
||||||
$userModel::where('email', $email)->update([
|
|
||||||
'terms_accepted_at' => now(),
|
|
||||||
'terms_version' => config('legal.terms_version'),
|
|
||||||
'privacy_policy_version' => config('legal.privacy_policy_version'),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$request->session()->put('login.email', $email);
|
$request->session()->put('login.email', $email);
|
||||||
|
|
||||||
return redirect()->route('login.code');
|
return redirect()->route('login.code');
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ protected function casts(): array
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'email_verified_at' => 'datetime',
|
'email_verified_at' => 'datetime',
|
||||||
'terms_accepted_at' => 'datetime',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When a new account was created from the login page, and which terms and
|
|
||||||
* privacy-policy versions its notice showed at the time (see
|
|
||||||
* Auth\LoginController::send()). Terms of sale are recorded per order.
|
|
||||||
*/
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
public function up(): void
|
|
||||||
{
|
|
||||||
Schema::table('users', function (Blueprint $table) {
|
|
||||||
$table->timestamp('terms_accepted_at')->nullable();
|
|
||||||
$table->string('terms_version')->nullable();
|
|
||||||
$table->string('privacy_policy_version')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::table('users', function (Blueprint $table) {
|
|
||||||
$table->dropColumn(['terms_accepted_at', 'terms_version', 'privacy_policy_version']);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -42,9 +42,9 @@
|
|||||||
/>
|
/>
|
||||||
</x-ui.field>
|
</x-ui.field>
|
||||||
|
|
||||||
{{-- Shown to everyone; for a new account, LoginController::send()
|
{{-- Shown to everyone. Recording acceptance for new accounts is a
|
||||||
records the time and the terms/privacy versions. Unescaped: the
|
boboko-core task (UserOtpService). Unescaped: the label holds the
|
||||||
label holds the two links (Language Lines, staff only). --}}
|
two links (Language Lines, staff only). --}}
|
||||||
<p class="text-sm text-neutral-500 [&_a]:underline [&_a:hover]:no-underline">
|
<p class="text-sm text-neutral-500 [&_a]:underline [&_a:hover]:no-underline">
|
||||||
{!! __('storefront.auth.terms_notice', [
|
{!! __('storefront.auth.terms_notice', [
|
||||||
'terms' => route('legal.terms'),
|
'terms' => route('legal.terms'),
|
||||||
|
|||||||
Reference in New Issue
Block a user