mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
Implement access token for command line things.
This commit is contained in:
10
app/User.php
10
app/User.php
@@ -136,6 +136,16 @@ class User extends Authenticatable
|
||||
return $this->hasMany('FireflyIII\Models\ExportJob');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function generateAccessToken(): string
|
||||
{
|
||||
$bytes = random_bytes(16);
|
||||
|
||||
return strval(bin2hex($bytes));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the user has a role by its name.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user