v0.9.11
This commit is contained in:
commit
c63e98e91e
297 files changed
+20546
No files matched your search
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user