Added Google Two Factor Authentication. Closes #326.
This commit is contained in:
committed by
James Brooks
parent
20f744602a
commit
de4ecf636f
@@ -44,7 +44,7 @@ class User extends Model implements UserInterface, RemindableInterface
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $hidden = ['password', 'remember_token'];
|
||||
protected $hidden = ['password', 'remember_token', 'google_2fa_secret'];
|
||||
|
||||
/**
|
||||
* The properties that cannot be mass assigned.
|
||||
@@ -133,4 +133,14 @@ class User extends Model implements UserInterface, RemindableInterface
|
||||
{
|
||||
return (bool) $this->level;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if a user has enabled two factor authentication.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getHasEnabled2FAAttribute()
|
||||
{
|
||||
return (bool) (trim($this->google_2fa_secret) !== '');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user