DONE: improve auth security, add email verification when register, add mailpit to docker service
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class BackfillEmailVerifiedAtForActiveUsers extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
// Existing active users predate email verification; keep them able to log in.
|
||||
DB::table('users')
|
||||
->where('status', 'active')
|
||||
->whereNull('email_verified_at')
|
||||
->update([
|
||||
'email_verified_at' => DB::raw('COALESCE(t_daftar, NOW())'),
|
||||
'is_verified' => 1,
|
||||
]);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
// Irreversible data backfill.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user