firefly-iii/app/Http/Requests/TokenFormRequest.php
James Cole ababdacf89 Some code cleanup
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
2016-03-14 20:53:56 +01:00

39 lines
570 B
PHP

<?php
declare(strict_types = 1);
namespace FireflyIII\Http\Requests;
use Auth;
/**
* Class TokenFormRequest
*
*
* @package FireflyIII\Http\Requests
*/
class TokenFormRequest extends Request
{
/**
* @return bool
*/
public function authorize()
{
// Only allow logged in users
return Auth::check();
}
/**
* @return array
*/
public function rules()
{
$rules = [
'secret' => 'required',
'code' => 'required|2faCode:secret',
];
return $rules;
}
}