mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-12 12:10:41 -05:00
This allows a user that was created via OAuth to set a local password on their account.
30 lines
794 B
PHP
30 lines
794 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\OAuthConnection;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
class OAuthConnectionFactory extends Factory
|
|
{
|
|
protected $model = OAuthConnection::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'user_id' => User::factory(),
|
|
'provider_name' => $this->faker->randomElement(['discord', 'google', 'facebook']),
|
|
'provider_id' => (string) $this->faker->unique()->numberBetween(100000, 999999),
|
|
'token' => Str::random(40),
|
|
'refresh_token' => Str::random(40),
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
];
|
|
}
|
|
}
|