Implement access token for command line things.

This commit is contained in:
James Cole
2017-09-14 18:27:22 +02:00
parent 43a66fd378
commit f54b4c3abc
6 changed files with 77 additions and 3 deletions

View File

@@ -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.
*