feat: harden identity and recovery operations
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use App\Domain\Identity\Enums\RoleName;
|
||||
use App\Domain\Identity\Models\ExternalIdentity;
|
||||
use App\Domain\Identity\Models\Role;
|
||||
use App\Domain\Reservations\Models\Reservation;
|
||||
use Database\Factories\UserFactory;
|
||||
@@ -58,6 +59,12 @@ class User extends Authenticatable implements PasskeyUser
|
||||
return $this->hasMany(Reservation::class, 'requester_id');
|
||||
}
|
||||
|
||||
/** @return HasMany<ExternalIdentity, $this> */
|
||||
public function externalIdentities(): HasMany
|
||||
{
|
||||
return $this->hasMany(ExternalIdentity::class);
|
||||
}
|
||||
|
||||
public function hasRole(RoleName|string $role): bool
|
||||
{
|
||||
$name = $role instanceof RoleName ? $role->value : $role;
|
||||
|
||||
Reference in New Issue
Block a user