Skip to content

Commit

Permalink
fix: change emails to lowercase on init
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Nov 3, 2024
1 parent 63cff9e commit f408d60
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Console/Commands/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use App\Models\ScheduledDatabaseBackup;
use App\Models\Server;
use App\Models\StandalonePostgresql;
use App\Models\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Http;
Expand Down Expand Up @@ -41,6 +42,7 @@ public function handle()
$this->disable_metrics();
$this->replace_slash_in_environment_name();
$this->restore_coolify_db_backup();
$this->update_user_emails();
//
$this->update_traefik_labels();
if (! isCloud() || $this->option('force-cloud')) {
Expand Down Expand Up @@ -92,6 +94,11 @@ private function disable_metrics()
}
}

private function update_user_emails()
{
User::whereRaw('email ~ \'[A-Z]\'')->get()->each(fn (User $user) => $user->update(['email' => strtolower($user->email)]));
}

private function update_traefik_labels()
{
try {
Expand Down

0 comments on commit f408d60

Please sign in to comment.