This commit is contained in:
deploy-bot committed 2026-12-05 15:01:51 +00:00
commit 574aed3a9a
287 files changed
+19547

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
<?php
namespace IriksIT\Manager\Models;
use Illuminate\Database\Eloquent\Model;
use IriksIT\Manager\Support\Names;
/**
* The second step of one account (ADR-0016). `secret` and `recovery_codes` are encrypted with the app key; the recovery codes are
* kept as hashes, so a leaked table gives neither a code nor the secret. A row with no secret is an account that has to set it up
* but has not (or was reset): `required_since` keeps the start of its grace period.
*
* @property ?string $secret
* @property list<string>|null $recovery_codes
*/
class TwoFactor extends Model
{
protected $fillable = ['user_id', 'secret', 'recovery_codes', 'confirmed_at', 'last_step', 'required_since'];
protected function casts(): array
{
return ['secret' => 'encrypted', 'recovery_codes' => 'encrypted:array', 'confirmed_at' => 'datetime', 'required_since' => 'datetime'];
}
public function getTable(): string
{
return Names::table('two_factor');
}
}